human
Schema:
basketball_match (Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral)
university (School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference)
Please answer with SQL.
assistant
Sure, I understand.
human
List all schools and their nicknames in the order of founded year.
assistant
SELECT school , nickname FROM university ORDER BY founded
human
What is the total and minimum enrollment of all schools?
assistant
SELECT sum(enrollment) , min(enrollment) FROM university
human
Find the founded year of the newest non public school.
assistant
SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
human
When was the school with the largest enrollment founded?
assistant
SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1
human
Find the schools that were either founded after 1850 or public.
assistant
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
human
What are the public schools and what are their locations?
assistant
SELECT school , LOCATION FROM university WHERE affiliation = "Public" ;