按照学号进行分组,统计学生的平均成绩,且平均分按降序排列
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)
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)
举一反三
- 按照学号进行分组,统计学生的平均成绩() A: select sid, avg(grade) from student group by cid B: select sid, avg(grade) from student group by sid C: select sid, avg(grade) from sc group by sid D: select sid, avg(grade) from sc group by cid
- 按照课程号进行分组,统计学生平均成绩大于60分的学生的信息( ) A: select cid,avg(grade) from sc group by cid having avg(grade)>60 B: select cid,avg(grade) from student group by cid having avg(grade)>60 C: select cid,avg(grade) from course where avg(grade)>60 group by cid D: select cid,avg(grade) from student where avg(grade)>60 group by cid
- 统计选修了a001课程的学生的平均成绩( ) A: select cid,avg(grade) from student group by cid having cid=’a001’ B: select cid,avg(grade) from student where cid=’a001’ group by cid C: select cid,avg(grade) from course where cid=’a001’ group by cid D: select cid,avg(grade) from sc where cid=’a001’ group by cid
- 表sc中存放了多个学生的多门课程的成绩,sno为学号,cno为课程号,grade为成绩。要查询平均分最高的学生学号和平均分,下列()语句可以实现。 A: SELECT top 1 sno,avg(grade) FROM sc group by sno order by avg(grade) desc B: SELECT sno,max(avg(grade)) FROM sc group by sno C: SELECT sno,max(grade), avg(grade) FROM sc group by sno D: SELECT sno,max(grade) FROM sc group by sno
- 设关系模式SCG (S#, C#, grade)中S#为学生学号,C#为课程号,grade为某学号学生学某号课程的考试成绩。今要查询每门课程的平均成绩,且要求查询的结果按平均成绩升序排列,平均成绩相同时,按课程号降序排列,则用SQL查询语言应为 (1) 。 若查询的结果仅限于平均分数超过80分的,则应 (2) 。 (1) A: Select C#,AVG(grade) From SCG Group by grade Order by 2,C# Desc B: Select C#,AVG(grade) From SCG Group by C# Order by 2,C# Desc C: Select C#,AVG(grade) From SCG Where C#,AVG Desc Group by grade D: Select C#,AVG(grade) From SCG Group by AVG(grade) Order by 2,C# Desc