查询每门课的平均分Selectcno,avg(grade)from()groupbycno
举一反三
- 查询每门课的平均分,并将平均分大于80分的显示输出Selectavg(grade)fromscgroupbycno()avg(grade)>=80
- 查询每门课的课程号和学分Selectcno,()fromcourse
- 按照学号进行分组,统计学生的平均成绩,且平均分按降序排列 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)
- 在选课关系SC(sno,cno,grade)中,统计每门课的选课人数,下面查询语句是否正确:Selectcno,count(*)FromscGroupbysno;
- 设关系模式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