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
How many colleges in total?
assistant
SELECT count(*) FROM College
human
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
assistant
SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college)
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
Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.
assistant
SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL')
human
What are the names of the colleges that are larger than at least one college in Florida?
assistant
SELECT DISTINCT cName FROM college WHERE enr > ( SELECT MIN( enr ) FROM college WHERE state = "FL" ) ;