在学生选课数据库中,检索被全部学生所选修的课程的SQL可以描述为( ) A: SELECT Cno FROM SC WHERE (Select Count(Sno) FROM SC GROUP BY Cno) = (SELECT Count(*) FROM Student) ; B: SELECT Cno FROM SC x WHERE NOT EXISTS (SELECT * FROM Student s WHERE NOT EXISTS (SELECT * FROM SC y WHERE x.Cno = y.Cno AND s.Sno= y.Sno); C: SELECT Cno FROM SC x WHERE NOT EXISTS (( SELECT Sno FROM Student) EXCEPT ( SELECT y.Sno FROM SC y, Student z WHERE x.Cno=y.Cno AND z.Sno=y.Sno)); D: 以上答案都不对
在学生选课数据库中,检索被全部学生所选修的课程的SQL可以描述为( ) A: SELECT Cno FROM SC WHERE (Select Count(Sno) FROM SC GROUP BY Cno) = (SELECT Count(*) FROM Student) ; B: SELECT Cno FROM SC x WHERE NOT EXISTS (SELECT * FROM Student s WHERE NOT EXISTS (SELECT * FROM SC y WHERE x.Cno = y.Cno AND s.Sno= y.Sno); C: SELECT Cno FROM SC x WHERE NOT EXISTS (( SELECT Sno FROM Student) EXCEPT ( SELECT y.Sno FROM SC y, Student z WHERE x.Cno=y.Cno AND z.Sno=y.Sno)); D: 以上答案都不对
在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。select sname from student swhere sno[]‘201815005’ and not exists (select * from sc x where x.sno='201815005' and not exists (select * from sc y where 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 sname from student swhere sno[]‘201815005’ and not exists (select * from sc x where x.sno='201815005' and not exists (select * from sc y where y.cno=x.cno and y.sno=s.sno ) )
A.SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno Desc B.SELECT Cno, AVG(Score) FROM SCS GROUP BY Cno ORDER BY 2, Cno Desc C.SELECT Cno, AVG(Score) FROM SCS WHERE Cno, Desc GROUP BY Score D.SELECT Cno, AVG(Score) FROM SCS GROUP BY, AVG(Score) ORDER BY, Cno Desc
A.SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno Desc B.SELECT Cno, AVG(Score) FROM SCS GROUP BY Cno ORDER BY 2, Cno Desc C.SELECT Cno, AVG(Score) FROM SCS WHERE Cno, Desc GROUP BY Score D.SELECT Cno, AVG(Score) FROM SCS GROUP BY, AVG(Score) ORDER BY, Cno Desc
在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。select sname from student swhere sno<>‘201815005’ and not exists (select * from sc x where x.sno='201815005' and not exists (select * from sc y where y.cno=x.cno and y.sno=s.sno ) ) A: 正确 B: 错误
在学生选课数据库中有学生表student(sno,sname,ssex,sage,sdept),课程表course(cno,cname)及学生选课表sc(sno,cno,grade),其中sno是学号,sname是姓名,ssex是性别,sage是年龄,sdept是系别,cno是课程号,cname是课程名,grade是成绩。查询至少选修了“201815005”同学所选课程的学生的姓名,可以使用如下SQL语句。select sname from student swhere sno<>‘201815005’ and not exists (select * from sc x where x.sno='201815005' and not exists (select * from sc y where y.cno=x.cno and y.sno=s.sno ) ) A: 正确 B: 错误
检索选课人数少于4人的课程号。正确的SQL语句是( ) A: SELECT CNO FROM SC WHERE COUNT(*)<;4 B: SELECT CNO FROM SC GROUP BY CNO HAVING COUNT(*)<;4 C: SELECT DISTINCT CNO FROM SC ORDER BY CNO D: SELECT CNO FROM SC WHERE COUNT(CNO)<;4
检索选课人数少于4人的课程号。正确的SQL语句是( ) A: SELECT CNO FROM SC WHERE COUNT(*)<;4 B: SELECT CNO FROM SC GROUP BY CNO HAVING COUNT(*)<;4 C: SELECT DISTINCT CNO FROM SC ORDER BY CNO D: SELECT CNO FROM SC WHERE COUNT(CNO)<;4
在“学生-选课-课程”数据库中的3个关系如下:S(SNO, SNAME, SEX, AGE); C(CNO, CNAME, TEACHER);SC(SNO, CNO, GRADE),查询既选修了“2”号又选修了“4”号课程的学生学号。若用关系代数表达式来表示为( )。 A: ПSNO (σCNO=’2’(SC) ∩ σCNO=’4’(SC) ) B: ПSNO (σCNO=’2’(SC)) ¥ ПSNO(σCNO=’4’(SC) ) C: ПSNO (σCNO=’2’(SC) ∪ σCNO=’4’(SC) ) D: σCNO=’2’(SC) ¥σCNO=’4’(SC)
在“学生-选课-课程”数据库中的3个关系如下:S(SNO, SNAME, SEX, AGE); C(CNO, CNAME, TEACHER);SC(SNO, CNO, GRADE),查询既选修了“2”号又选修了“4”号课程的学生学号。若用关系代数表达式来表示为( )。 A: ПSNO (σCNO=’2’(SC) ∩ σCNO=’4’(SC) ) B: ПSNO (σCNO=’2’(SC)) ¥ ПSNO(σCNO=’4’(SC) ) C: ПSNO (σCNO=’2’(SC) ∪ σCNO=’4’(SC) ) D: σCNO=’2’(SC) ¥σCNO=’4’(SC)
在MySQL中,假设有学生选课表SC(sno,cno,score)。那么列出所有选修课程超过5门的学生学号以及选修课程数目,其正确的SQL语句为()。 A: select sno,count(cno)from scwhere count(cno)>=5; B: select sno,count(cno)from scgroup by sno where count(cno)>=5; C: select sno,count(cno)from scgroup by sno having count(cno)>=5; D: select sno,count(cno)from scgroup by cno having count(cno)>=5;
在MySQL中,假设有学生选课表SC(sno,cno,score)。那么列出所有选修课程超过5门的学生学号以及选修课程数目,其正确的SQL语句为()。 A: select sno,count(cno)from scwhere count(cno)>=5; B: select sno,count(cno)from scgroup by sno where count(cno)>=5; C: select sno,count(cno)from scgroup by sno having count(cno)>=5; D: select sno,count(cno)from scgroup by cno having count(cno)>=5;
在学生选课数据库中有学生表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 ) )
若系统使用频度最高的查询语句为SELECT*FROMSCWHERESno=xANDCno=y;//其中x,y为变量为使该查询语句的执行效率最高,应创建() A: Sno上的索引 B: Cno上的索引 C: Sno,Cno上的索引 D: SC上的视图SC_V(Sno,Cno)
若系统使用频度最高的查询语句为SELECT*FROMSCWHERESno=xANDCno=y;//其中x,y为变量为使该查询语句的执行效率最高,应创建() A: Sno上的索引 B: Cno上的索引 C: Sno,Cno上的索引 D: SC上的视图SC_V(Sno,Cno)
统计每门课程的选课人数select cno , _________from scgroup by ________ A: count(*) ; cno B: count(sno) ; cno C: count(*) ; sno D: count(sno) ; sno
统计每门课程的选课人数select cno , _________from scgroup by ________ A: count(*) ; cno B: count(sno) ; cno C: count(*) ; sno D: count(sno) ; sno