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
List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.
assistant
SELECT cName FROM College WHERE enr > 18000 ORDER BY cName
human
How many colleges has more than 15000 students?
assistant
SELECT count(*) FROM College WHERE enr > 15000
human
What is average enrollment of colleges in the state FL?
assistant
SELECT avg(enr) FROM College WHERE state = 'FL'
human
What is the number of states that has some college whose enrollment is larger than the average enrollment?
assistant
SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)
human
How many colleges in total?
assistant
SELECT count(*) FROM College
human
In which state is the college that Charles attends?
assistant
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = "Charles" ;