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
举一反三
- 结构化查询语言SQL是一种______语言,其主要功能有______,它的典型句型为SELECT A1,A2,…,An FROM r1,r2,…,rm WHERE F 其中A1,A2,…,An和F分别是______。 关系模式SCS(Sno,Cno,Score)中,Sno是学生的学号,Cno是课程号,Score为成绩。若要查询每门课程的平均成绩,且要求查询结果按平均成绩升序排列。平均成绩相同时,按课程号降序排列,可用SQL语言写为______。若查询结果仅限于平均分数超过85分的,则应______。 A: SELECT Cno, AVG(Score) FROM SCS GROUP BY Score ORDER BY 2, Cno DESC B: SEIECT 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 GROU PBY, AVG(Score) ORDER BY, Cno DESC
- 完善以下SQL语句,在课程表CInfo(CNo,CName)、成绩表SCInfo(StID,CNo,Score)中,查询平均成绩在80分(含80)以上的课程名称与平均成绩,并按平均成绩降序排序。(注:使用大写字母答题)SELECT CName, AVG(Score) 平均成绩FROM CInfo c JOIN SCInfo sc ON c.CNo=sc.CNo GROUP BY CName__________ AVG(Score)>=80ORDER BY 平均成绩 DESC
- 查询选课关系SC(Sno,Cno,Score)表中还没有给定成绩()的课程号()和学号(),下列语句正确的是。() A: SELECT<br/>Sno,Cno<br/>FROM SC WHERE Score IS NULL B: SELECT*<br/>FROM SC WHERE Score =NULL C: SELECT<br/>Sno,Cno<br/>FROM SC D: SELECT<br/>Score FROM SC WHERE Sno,Cno<br/>IS NOT NULL
- 下列选项中,能够按照 score 由高到低显示 student 表中记录的 SQL 语句是 A: SELECT* FROM student ORDER BY score ; B: SELECT* FROM student ORDER BY score ASC ; C: SELECT * FROM student ORDER BY score DESC ; D: SELECT* FROM student GROUP BY score DESC ;
- 检索选课人数少于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