Database: university_basketball

Question: When was the school with the largest enrollment founded?
SQL: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1

Question: Find the founded year of the newest non public school.
SQL: SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1

Question: What is the highest acc percent score in the competition?
SQL: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1

Question: What is the primary conference of the school that has the lowest acc percent score in the competition?
SQL: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1

Question: What is the team name and acc regular season score of the school that was founded for the longest time?
SQL: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1

Question: Find the location and all games score of the school that has Clemson as its team name.
SQL: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'

Question: Show the enrollment and primary_conference of the oldest college.
SQL: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1

Question: What is the total and minimum enrollment of all schools?
SQL: SELECT sum(enrollment) ,  min(enrollment) FROM university

Question: How many schools do not participate in the basketball match?
SQL: SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)

Question: Find the schools that were either founded after 1850 or public.
SQL: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'

Question: Find how many school locations have the word 'NY'.
SQL: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"

Question: Find the team names of the universities whose enrollments are smaller than the average enrollment size.
SQL: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)

Question: Find the number of universities that have over a 20000 enrollment size for each affiliation type.
SQL: SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation