select course ,count(*) from <表名> group by course;
SELECT MAX(各门课程),COUNT(学生ID) FROM TABLENAME GROUP BY 各门课程