human
Schema:
school (School_ID, School, Location, Enrollment, Founded, Denomination, Boys_or_Girls, Day_or_Boarding, Year_Entered_Competition, School_Colors)
school_details (School_ID, Nickname, Colors, League, Class, Division)
school_performance (School_Id, School_Year, Class_A, Class_AA)
player (Player_ID, Player, Team, Age, Position, School_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
Please show different denominations and the corresponding number of schools.
assistant
SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination
human
List the locations of schools in ascending order of enrollment.
assistant
SELECT LOCATION FROM school ORDER BY Enrollment ASC
human
Show the nicknames of schools that are not in division 1.
assistant
SELECT Nickname FROM school_details WHERE Division != 'Division 1'
human
List the locations of schools in descending order of founded year.
assistant
SELECT LOCATION FROM school ORDER BY Founded DESC
human
How many schools are there?
assistant
SELECT count(*) FROM school
human
What are the location and nickname of each school?
assistant
SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID ;