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
What is the average enrollment size?
assistant
SELECT AVG ( enrollment ) FROM university;
human
Which schools have basketball team?
assistant
SELECT School FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID;
human
Please list the enrollment of these schools.
assistant
SELECT School , Enrollment FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID;
human
Which of them have enrollments that are smaller than the average enrollment size?
assistant
SELECT School FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < ( SELECT AVG ( enrollment ) FROM university );
human
Please list their team names.
assistant
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 ) ;