How many students are majoring in "600"?
select count ( stuid ) from student where major = 600
Can you show me only those students?
select stuid from student where major = 600
Can you also show me what clubs they are in?
select t1.clubname from club as t1 join member_of_club as t2 on t1.clubid = t2.clubid join student as t3 on t2.stuid = t3.stuid where t3.major = "600" group by t1.clubname
How many students who are majoring in 600 are in each of those clubs?
select t1.clubname,count ( * ) from club as t1 join member_of_club as t2 on t1.clubid = t2.clubid join student as t3 on t2.stuid = t3.stuid where t3.major = "600" group by t1.clubname order by count ( * )