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
Find the name of different colleges involved in the tryout in alphabetical order.
assistant
SELECT DISTINCT cName FROM tryout ORDER BY cName
human
Which colleges do the tryout players whose name starts with letter D go to?
assistant
SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'
human
Which college has any student who is a goalie and succeeded in the tryout.
assistant
SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
human
How many students got accepted after the tryout?
assistant
SELECT count(*) FROM tryout WHERE decision = 'yes'
human
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.
assistant
SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
human
How many different colleges were represented at tryouts?
assistant
SELECT COUNT( DISTINCT cName ) FROM tryout ;