human
Schema:
College (cName, state, enr)
Player (pID, pName, yCard, HS)
Tryout (pID, cName, pPos, decision)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the average enrollment?
assistant
SELECT AVG ( enr ) FROM college;
human
Now please list all colleges that have enrollment higher than the average. | LSU, OU, and FSU have enrollment higher than the average. | Please list the states where LSU, OU, and FSU are located.
assistant
SELECT DISTINCT state FROM college WHERE enr > ( SELECT AVG ( enr ) FROM college );
human
How many total states are in the table?
assistant
SELECT COUNT( DISTINCT state ) FROM college WHERE enr > ( SELECT AVG ( enr ) FROM college ) ;