摘要: 学生表 S(sid,name,sex,age)课程表 C(cid,name)学生选课关联表 SC(sid,cid,score)查询选修全部课程的学生姓名:select S.name from Swhere not exists( select * from Cwhere not exists( select * from SC where sid=S.sid and cid=C.cid ))解释: 最里层的子查询用于查找某个学生选修的所有课程; 中间层的子查询(结合not exists)用于查找该学生没有选修的课程; 最外层的查询(结合not exists)用于查找不... 阅读全文
posted @ 2012-03-14 15:00 chenyizh 阅读(3071) 评论(0) 推荐(0) 编辑