Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.

### Tables ###
TABLE: CREATE TABLE restaurant ( resid number, resname text, address text, rating number )
TABLE: CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text )
TABLE: CREATE TABLE type_of_restaurant ( resid number, restypeid number )
TABLE: CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number )
TABLE: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text )

### Question ###
Which major has between 2 and 30 number of students? List major and the number of students.

### Accurate SQL ###

SELECT major, COUNT(*) FROM student GROUP BY major HAVING COUNT(major) BETWEEN 2 AND 30