第九题:
先获取01同学所学的所有课程编号b们,
(select cid from sc where sid='01') b
问题转化为,查询b表中课程都学过的所有学生sid,有了sid剩下的就好办啦
所有课程都学过这个可以用双重not exist来表达
select sid
from student
where not exists (
select 1 from (select cid from sc where sid='01') b
where not exists(
select 1 from sc where sc.sid=student.sid and sc.cid=b.cid
)
)