查询选修le全部课程的学生姓名
select sname
from student
where not exists
(select *
from course
where not exists
(select *
from sc
where sno =student.sno
select sname
from student
where not exists
(select *
from course
where not exists
(select *
from sc
where sno =student.sno
and cno=course.cno)
第一问:两个NOT EXISTS表示双重否定:没有一个选了课的学生没有选course表里的课程
select sname
from student
where not exists /*没有一个学生满足以下的条件*/
(select * from course
where not exists /*什么条件呢?没有选过Course表里的课*/
(select * from sc
where sno =student.sno /*这里两个=分别指对应的关系,表示选过课并且是
and cno=course.cno) Course的课,只不过用not exists否定掉了*/