第二十六题
查询每门课程被选修的学生数
select sc.c_id,c.c_name,count(*) as cnt
from score sc left join course c on sc.c_id = c.c_id
group by sc.c_id;
第二十七题
查询出只有两门课程的全部学生的学号和姓名
select s.s_id,s.s_name from
student s inner join score sc
on s.s_id = sc.s_id
group by sc.s_id having count(*) = 2;
第二十八题
查询男生、女生人数
select s_sex,count(*) as cnt from student group by s_sex;
第二十九题
查询名字中含有"风"字的学生信息
select * from student s where s_name like "%风%";
第三十题
查询同名同性学生名单,并统计同名人数
select *,count(*) as cnt from student group by s_sex,s_name having count(*)>1;