高等教育 / 数据库原理及应用(管理类)
有三个表即学生表S、课程表C和学生选课表SC,它们的结构如下:
S(S#,SN,SEX,AGE,DEPT)
C(C#,CN)
SC(S#,C#,GRADE)
其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号,CN为课程名,GRADE为成绩。
检索选修四门以上课程的学生总成绩(不统计不及格的课程),并要求按总成绩的降序排列出来。正确的SELECT语句是________。
A、SELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 GROUP BY S# ORDER BY 2 DESC HAVING COUNT(*)>=4 WHERE C#=“C2”AND GRADE>= (SELECT GRADE FORM SC WHERE C#=“C2”)
B、SELECT S#FORM SC WHERE C#=“C2”AND GRADE IN (SELECT GRADE FORM SC WHERE C#=“C2”)
C、SELECT S#FORM SC WHERE C#=“C2”AND GRADE NOT IN (SELECT GRADE FORM SC WHERE C#=“C2”)
D、SELECT S#FORM SC WHERE C#=“C2”AND GRADE>=ALL (SELECT GRADE FORM SC WHERE C#=“C2”)
S(S#,SN,SEX,AGE,DEPT)
C(C#,CN)
SC(S#,C#,GRADE)
其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号,CN为课程名,GRADE为成绩。
检索选修四门以上课程的学生总成绩(不统计不及格的课程),并要求按总成绩的降序排列出来。正确的SELECT语句是________。
A、SELECT S#,SUM(GRADE)FROM SC WHERE GRADE>=60 GROUP BY S# ORDER BY 2 DESC HAVING COUNT(*)>=4 WHERE C#=“C2”AND GRADE>= (SELECT GRADE FORM SC WHERE C#=“C2”)
B、SELECT S#FORM SC WHERE C#=“C2”AND GRADE IN (SELECT GRADE FORM SC WHERE C#=“C2”)
C、SELECT S#FORM SC WHERE C#=“C2”AND GRADE NOT IN (SELECT GRADE FORM SC WHERE C#=“C2”)
D、SELECT S#FORM SC WHERE C#=“C2”AND GRADE>=ALL (SELECT GRADE FORM SC WHERE C#=“C2”)
参考答案:
佳题速递: