本文主要是介绍SQL语句,检索至少选修了“S001”所学课程的学生名单,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
关系 Student,SC,Course,Teacher
Student(Snum,Sname,Ssex,Sage)
SC(Cnum,Cname,Tnum)
Course(Cnum,Cname,Tnum)
select * from Student
where Snum in
( select distinct Snum from SC xwhere not exists(select * from SC ywhere y.Snum='S001' and not exists(select * from SC zwhere z.Cnum=y.Cnum and z.Snum=x.Snum))
)
这篇关于SQL语句,检索至少选修了“S001”所学课程的学生名单的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!