human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Voting_record (StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the city code of the city that the most students live in?
assistant
SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT( * ) DESC LIMIT 1;
human
What is the city code of the city that the least students live in?
assistant
SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT( * ) LIMIT 1;
human
What is the average age of all the students?
assistant
SELECT AVG ( Age ) FROM STUDENT ;