human
Schema:
Allergy_Type (Allergy, AllergyType)
Has_Allergy (StuID, Allergy)
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the minimum, average, and maximum age of all students.
assistant
SELECT min(age) , avg(age) , max(age) FROM Student
human
How many different advisors are listed?
assistant
SELECT count(DISTINCT advisor) FROM Student
human
Show first name and last name for all students.
assistant
SELECT Fname , Lname FROM Student
human
Who is the advisor of student with ID 1004?
assistant
SELECT Advisor FROM Student WHERE StuID = 1004
human
Show all advisors and corresponding number of students.
assistant
SELECT advisor , count(*) FROM Student GROUP BY advisor
human
Give the advisor with the most students.
assistant
SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT( * ) DESC LIMIT 1 ;