求解sql一道试题,会的答一下啊!谢了

2025-03-24 07:20:19
推荐回答(1个)
回答1:

1.select 班级编号,count(*) from 学生表 where xb='男' group by 班级编号 having count(*)>10
2.select a.班级编号,count(*) from 学生表 a,
(select 班级编号 from 学生表 where xb='女' group by 班级编号 having count(*)>20) b
where a.班级编号=b.班级编号
and a.xb='男'
3.select c.kcmc,b.pscj,b.qmcj,b.kccj from 学生表 a,选课表 b,课程表 c
where a.xh=b.xh
and b.kcbh=c.kcbh
and a.xm='王杨'
4.select xm from 学生表 where xh in
(select xh from 课程表 where kcbh='1000092')