sql嵌套查询

来源:互联网 发布:微信支付开发案例java 编辑:程序博客网 时间:2024/06/18 08:20

书上练习题



select student.studentName,student.studentNo ,Course.courseName ,score.score 

from student,Course ,Score where student.studentNo in (
select a.studentNo from Score a,Course b 
where a.courseNo=b.courseNo and b.courseName='高等数学' and 
a.studentNo in(  select a.studentNo from Score a,Course b where a.courseNo=b.courseNo and b.courseName='计算机原理'))
and student.studentNo=score.studentNo and score.courseNo= Course.courseNo and Course.courseName in('高等数学','计算机原理');
0 0