• 2022-06-07
    关系SC(Sno,Cno,Grade)表示学号,课程号,成绩。现要查询平均分在90分以上的学生的学号和平均成绩,正确的语句是______。
    A: SELECT Sno,AVG(Grad FROM SC WHERE AVG(Grad>=90 GROUP BY Sno
    B: SELECT Sno,AVG(Grad FROM SC GROUP BY Sno HAVING AVG(Grad>=90
    C: SELECT Sno,AVG(Grad FROM SC WHERE AVG(Grad>=90 ORDER BY Sno
    D: SELECT Sno,AVG(Grad FROM SC GROUP BY Cno HAVING AVG(Grad>=90
  • B

    举一反三

    内容

    • 0

      针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下( )语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select sno from sc where grade>90 group by sno having count(cno)>2; B: select sno from sc where grade>90 group by sno having count(*)>2; C: select sno from sc where grade>90 and count(*)>2 group by sno; D: select sno from sc where grade>90 group by sno having count(sno)>2;

    • 1

      查询平均成绩小于70分的学生学号和平均成绩 A: SELECT Sno, AVG(grade) FROM  SC GROUPBYSno B: SELECT Sno, AVG(grade) FROM  SC GROUPBYSno  HAVINGAVG(grade)<70; C: SELECT Sno, grade FROM  SC GROUPBYSno HAVINGAVG(grade)<70;

    • 2

      关系SC(Sno,Cno,Grade)表示学号,课程号,成绩。现要查询最高分在91分以上的学生的学号和平均成绩,正确的语句是______。 A: SELECT Sno,MAX(Grade) FROM SC WHERE MAX(Grade)>=91 GROUP BY Sno B: SELECT Sno,MAX(Grade) FROM SC GROUP RY Sno HAVING MAX(Grade)>=91 C: SELECT Sno,MAX(Grade) FROM SC WHERE MAX(Grade)>=91 ORDER BY Sno D: SELECT Sno,MAX(Grade) FROM SC GROUP BY Cno HAVING MAX(Grade)>=91

    • 3

      针对表SC(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下哪个操作( )统计出每位学生所选课程的最高分和最低分。 A: select sno,max(grade), min(grade) from sc B: select sno,max(grade), min(grade) from sc order by sno C: select sno,max(grade), min(grade) from sc group by sno D: select sno,avg(grade), sum(grade) from sc group by sno

    • 4

      关系SC(Sno,Cno,Grade)表示学号、课程号、成绩。现要查询最高分在91分以上的学生的学号和平均成绩,正确的语句是______。 A: SELECT Sno,MAX(Grade)<br> FROM SC<br> WHERE MAX(Grade)≥91<br> GROUP BY Sno B: SELECT Sno,MAX(Grade)<br> FROM SC<br> GROUP BY Sno<br> HAVING MAX(Grade)≥91 C: SELECT Sno,MAX(Grade)<br> FROM SC<br> WHERE MAX(Grade)≥91<br> ORDER BY Sno D: SELECT Sno,MAX(Grade)<br> FROM SC<br> GROUP BY Cno<br> HAVING MAX(Grade)≥91