【单选题】
检索选修四门以上课程的学生总成绩,并要求按总成绩的降序排列出来。正确的SELECT语句是( )。
①
SELECTSNO, SUM (GRADE) FROM SC GROUP BYSNO ORDER BY2 DESC HAVING COUNT(*) >= 4;
②
SELECTSNO, SUM (GRADE) FROM SC GROUP BYSNO HAVING COUNT(*)>=4 ORDER BY2 DESC;
③
SELECTSNO, SUM (GRADE) FROM SC HAVING COUNT(*)>=4 GROUP BYSNO ORDER BY2 DESC;
④
SELECTSNO, SUM (GRADE) FROM SC ORDER BY2 DESC GROUP BYSNO HAVING COUNT(*)>=4;
【单选题】
检索选修四门以上课程的学生总成绩,并要求按总成绩的降序排列出来。正确的SELECT语句是( )。
①
A.SELECTSNO, SUM (GRADE) FROM SC GROUP BYSNO ORDER BY2 DESC HAVING COUNT(*)
②
B.SELECTSNO, SUM (GRADE) FROM SC GROUP BYSNO HAVING COUNT(*)=4 ORDER BY2 DESC;
③
C.SELECTSNO, SUM (GRADE) FROM SC HAVING COUNT(*)=4 GROUP BYSNO ORDER BY2 DESC;
④
D.SELECTSNO, SUM (GRADE) FROM SC ORDER BY2 DESC GROUP BYSNO HAVING COUNT(*)
【单选题】
查询计算机系选修了5门以上课程的学生姓名。下面SQL语句中正确的是( )。
①
SELECT 姓名 FROM 选课单 WHERE 系=’计算机’AND COUNT(*)>5
②
SELECT 姓名 FROM 选课单 WHERE 系=’计算机’AND COUNT(*)>5 GROUP BY 姓名
③
SELECT 姓名 FROM 选课单 WHERE 系=’计算机’GROUP BY 姓名 HAVING COUNT(*)>5
④
SELECT 姓名 FROM 选课单 WHERE系=’计算机’GROUP BY 姓名 HAVING系=’计算机’AND COUNT(*)>5
【简答题】
设有学生选课表SC(学号,课程号,成绩),用SQL语言检索每门课程的课程号及平均分的语句就是 (关键字必须拼写完整 )SELECT 课程号 ,AVG(成绩 ) FROM SC[填空1]