Which major has between 2 and 30 number of students?
select major from student group by major having count(major) between 2 and 30;
Count that, too.
select major, count(*) from student group by major having count(major) between 2 and 30;