32、查询与敖爽在同一个系学习的学生
select Sno,Sname,Sdept from Student where Sdept in
(select Sdept from Student where Sname='敖爽')
33、查询选修了课程名为数据库的学生学号和姓名
select Sno,Sname from Student where Sno in
(select Sno from SC where Cno in
(select Cno from Course
where Cname='数据库'))
34、找出每个学生超过他选修平均成绩的课程号
select Sno,Cno from SC x
where Greade>=(select AVG(Greade) from SC y
where y.Sno=x.Sno)
35、查询没有选修1号课程的学生姓名
select Sname from Student where not exists (
select * from SC
where SC.Sno=Student.Sno and Cno='1' )
36、查询至少选修了学生001选修的全部课程的学生号码
select distinct Sno from SC x
where not exists (
select * from SC y
where y.Sno='001'and not exists
(select * from SC z
where z.Sno=x.Sno and z.Cno=y.Cno ) )
37、查询选修了课程1或是课程2的学生
select Sno from SC where Cno='1' union Select Sno from SC where Cno='2'