2019-07-10
阅读量:
1342
查询学过“011”和“002”课程的同学的学号、姓名
Student(S#,Sname,Sage,Ssex)学生表
S#:学号
Sname:学生姓名
Sage:学生年龄
Ssex:学生性别
Course(C#,Cname,T#)课程表
C#:课程编号
Cname:课程名称
T#:教师编号
SC(S#,C#,score)成绩表
S#:学号
C#:课程编号
score:成绩
Teacher(T#,Tname)教师表
T#:教师编号:
Tname:教师名字
select Student.S#,Student.Sname
from Student,SC where Student.S#=SC.S#
and SC.C#='001'and
exists( Select * from SC as SC_2 where SC_2.S#=SC.S# and SC_2.C#='002');






评论(0)


暂无数据