有谁能写下sql server2012语句?谢谢

有三个表,
一个是课程表:Course(Cno,Cname,Credeit,Teacher)Cno是主键
一个是学生表:Student(Sno,Sname,Ssex,Sage,Sdept)Sno是主键
一个是选课表:SC(Sno,Cno,Grade),Sno,Cno是主键也是外键
检索每一门课程成绩都大于等于80 分的学生学号、姓名和性别,并把检索到的值送往另
一个已存在的基本表S(SNO,SNAME,SEX)。
最新回答
震撼鲜师◤╕

2024-11-26 01:54:38

select Sno,Sname,Ssex from Student a(nolock) where a.Sno not in (select y.Sno from (select * from Student where Sdept>=80) x right join SC y on x.Sno=y.Sno where x.Sno is null)
追问
看不懂
㈠朵烟熏的埖

2024-11-26 03:53:10

Insert into S(SNO,SNAME,SEX)
Select Sno,sname,ssex
From student t1
Where not exists(select *
From sc t2
Where t1.sno=t2.sno and grade>=80)
追问
错吧,它的要求是每一门课都大于80