1、数据查询:在学生-课程数据库中用SQL指令完成以下查询
(1)查询选修了所有课程的学生姓名。
select sname from student
where not exists
(select * fromcourse
where notexists
(select* from sc
where sno=student.sno
and cno=course.Cno))
(2)查询至少选修了学号为200215122的学生所选的所有课程的学生姓名。
select distinct sname
from student,sc
where not exists
(select* from sc s1
where s1.sno='200215122' and
not exists
(select* from sc s2
where s2.sno=s1.sno and
s2.cno=s1.cno))
(3)实现集合并运算,查询选修“数据库”课程或“信息系统”课程的学生学号。
select sno from sc
where cno =(select cno fromcourse where cname='数据库')
union
select sno from sc
where cno =(select cno fromcourse where cname='信息系统')
(4)实现集合交运算,查询既选修了“数据库”又选修了“信息系统”的学生学号。
select sno