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
Number of students in each major?
assistant
SELECT Major , COUNT( * ) FROM STUDENT GROUP BY major;
human
List of majors?
assistant
SELECT distinct ( Major ) FROM STUDENT;
human
Names of students in each major? | LName or FName? | LName.
assistant
SELECT Major , LName FROM STUDENT;
human
What about FName?
assistant
SELECT Major , FName FROM STUDENT;
human
Which major has the most number of students?
assistant
SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT( * ) DESC LIMIT 1 ;