首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

两个not exist有关问题

2012-12-17 
两个not exist问题学生表(学号,名字)student(sno,sname)选课表(学号,课程号)sc(sno,cno)课程表(课程号,课

两个not exist问题
学生表(学号,名字)student(sno,sname)
选课表(学号,课程号)sc(sno,cno)
课程表(课程号,课程名)course(cno,cname)
注:不是每个学生都会选课
查询选修了全部课程的学生姓名
书上的代码为
select sname
from student
where not exists
  (select *
  from course
  where not exists
  (select *
  from sc
  where sno=student.sno
  and cno=course.cno))

热点排行