• 2022-10-26 问题

    ‍下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“找出每个学生超过他选修课程平均成绩的课程号”。‍ A: SELECT Sno,CnoFROM SC xWHERE Grade >=(SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno) B: SELECT Sno,CnoFROM SC xWHERE (SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno)<=Grade C: SELECT Sno,CnoFROM SC WHERE Grade >=(SELECT AVG(Grade) FROM SC ) D: SELECT x.Sno,x.CnoFROM SC x, SC yWHERE y.Sno=x.Sno AND x.Grade >=(SELECT AVG(Grade) FROM y)

    ‍下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“找出每个学生超过他选修课程平均成绩的课程号”。‍ A: SELECT Sno,CnoFROM SC xWHERE Grade >=(SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno) B: SELECT Sno,CnoFROM SC xWHERE (SELECT AVG(Grade) FROM SC y WHERE y.Sno=x.Sno)<=Grade C: SELECT Sno,CnoFROM SC WHERE Grade >=(SELECT AVG(Grade) FROM SC ) D: SELECT x.Sno,x.CnoFROM SC x, SC yWHERE y.Sno=x.Sno AND x.Grade >=(SELECT AVG(Grade) FROM y)

  • 2022-06-09 问题

    在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。select snamefrom student swhere sno<;>;‘201815005’ and not exists(select *from sc xwhere x.sno='201815005' and not exists(select *from sc ywhere y.cno=x.cno and y.sno=s.sno ) )

    在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。select snamefrom student swhere sno<;>;‘201815005’ and not exists(select *from sc xwhere x.sno='201815005' and not exists(select *from sc ywhere y.cno=x.cno and y.sno=s.sno ) )

  • 1