human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Dorm (dormid, dorm_name, student_capacity, gender)
Dorm_amenity (amenid, amenity_name)
Has_amenity (dormid, amenid)
Lives_in (stuid, dormid, room_number)
Please answer with SQL.
assistant
Sure, I understand.
human
list all of the different majors.
assistant
SELECT distinct major FROM student;
human
which major has the fewest students?
assistant
SELECT major FROM student GROUP BY major ORDER BY COUNT( * ) LIMIT 1;
human
what is the most popular major?
assistant
SELECT major FROM student GROUP BY major ORDER BY COUNT( * ) DESC LIMIT 1 ;