(3)统计选修四门以上课程的学生的学号和总成绩(不统计不及格的课程),并要求按总成绩降序排列出来。正确的SELECT语句是( )。
A: SELECT S
B: ,SUM(GRADE) FORM SCGROUP BY S
C: HAVING COUNT(*)>=4;
D: SELECT S
E: ,SUM(GRADE) FORM SCGROUP BY S
F: HAVING COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
G: SELECT S
H: ,SUM(GRADE) FROM SCWHERE GRADE>=60GROUP BY S
I: HAVING COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
J: SELECT S
K: ,SUM(GRADE) FROM SCGROUP BY S
L: HAVING GRADE>=60 AND COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
A: SELECT S
B: ,SUM(GRADE) FORM SCGROUP BY S
C: HAVING COUNT(*)>=4;
D: SELECT S
E: ,SUM(GRADE) FORM SCGROUP BY S
F: HAVING COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
G: SELECT S
H: ,SUM(GRADE) FROM SCWHERE GRADE>=60GROUP BY S
I: HAVING COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
J: SELECT S
K: ,SUM(GRADE) FROM SCGROUP BY S
L: HAVING GRADE>=60 AND COUNT(*)>=4ORDER BY SUM(GRADE) DESC;
举一反三
- 下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“查询选修并成绩良好3门以上课程的学生学号及其满足条件的课程门数”。 A: SELECT Sno,COUNT(*)FROM SCGROUP BY SnoHAVING Grade>=80 AND COUNT(*) >3 B: SELECT Sno,COUNT(*)FROM SCWHERE Grade>=80GROUP BY SnoHAVING COUNT(*) >3 C: SELECT Sno,COUNT(*)FROM SCGROUP BY SnoWHERE Grade>=80HAVING COUNT(*) >3 D: SELECT Sno,COUNT(*)FROM SCGROUP BY SnoWHERE Grade>=80 AND HAVING COUNT(*) >3
- 检索选修课程‘C2’的学生中成绩最高的学生的学号。正确的SELECT语句是( )。 A: SELECT S B: FORM SCWHERE C C: =‘C2’ AND GRADE>=(SELECT GRADE FORM SCWHERE C D: =‘C2’) E: SELECT S F: FORM SCWHERE C G: =‘C2’ AND GRADE IN(SELECT GRADE FORM SCWHERE C H: =‘C2’) I: SELECT S J: FORM SCWHERE C K: =‘C2’ AND GRADE NOT IN(SELECT GRADE FORM SCWHERE C L: =‘C2’) M: SELECT S N: FORM SCWHERE C O: =‘C2’ AND GRADE>=ALL(SELECT GRADE FORM SCWHERE C P: =‘C2’)
- 统计学生成绩中的最高分,下列语句正确的是 A: SELECT AVG(grade) FROM student; B: SELECT (SUM(grade) / Count(id)) FROM student; C: SELECT MAX(grade) FROM student; D: SELECT MIN(grade) FROM student;
- 检索选修课程“C2”的学生中成绩最高的学生的学号。正确的SELECT语句是( ). A: SELECT S B: FORM SC WHERE C C: =“C2” AND GRAD>=(SELECT GRADE FORM SCWHERE C D: =“C2”) E: SELECT S F: FORM SCWHERE C G: =“C2” AND GRADE IN(SELECT GRADE FORM SCWHERE C H: =“C2”) I: SELECT S J: FORM SCWHERE C K: =“C2” AND GRADE NOT IN(SELECT GRADE FORM SCWHERE C L: =“C2”) M: SELECT S N: FORM SCWHERE C O: =“C2” AND GRADE>=ALL(SELECT GRADE FORM SCWHERE C P: =“C2”)
- 按照学号进行分组,统计学生的平均成绩,且平均分按降序排列 A: select sid, avg(grade) from sc group by sid order by avg(grade) desc B: select sid, avg(grade) from sc group by cid order by avg(grade) desc C: select sid, avg(grade) from student group by sid order by avg(grade) desc D: select sid, avg(grade) from student group by cid order by avg(grade)