human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Restaurant (ResID, ResName, Address, Rating)
Type_Of_Restaurant (ResID, ResTypeID)
Restaurant_Type (ResTypeID, ResTypeName, ResTypeDescription)
Visits_Restaurant (StuID, ResID, Time, Spent)
Please answer with SQL.
assistant
Sure, I understand.
human
List major and number of students for majors with 2 to 30 number of students
assistant
SELECT Major , COUNT( * ) FROM Student GROUP BY Major HAVING COUNT( Major ) BETWEEN 2 AND 30;
human
Which majors have between 2 and 20 students? Show me major and number of students
assistant
SELECT Major , COUNT( * ) FROM Student GROUP BY Major HAVING COUNT( Major ) BETWEEN 2 AND 20 ;