关系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
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
举一反三
- 关系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
- 针对表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
- 表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
- 已知关系模式:sc(sno,sname,grade),各属性含义依次为学号、课程名、分数。要查找“数据库”课分数最高的学生的学号,正确的SQL语句是 A: SELECT sno FROM sc WHERE sname = "数据库" AND grade = MAX(grade) B: SELECT sno FROM sc FOR sname = "数据库" OR grade>=MAX(grade) C: SELECT sno FROM sc WHERE sname = "数据库" AND grade = (SELECT MAX(grade) FROM sc) D: SELECT sno FROM sc FOR sname = "数据库" OR grade = (SELECT MAX(grade) FROM sc)
- 已知关系模式:SC(sno,sname,grade),各属性含义依次为学号、课程名、分数。要查找“数据库”课分数最高的学生的学号,正确的SQL语句是( )。 A: SELECT sno FROM sc WHERE sname="数据库"AND grade=MAX(grade) B: SELECT sno FROM sc FOR sname="数据库"OR grade>=MAX(grade) C: SELECT sno FROM sc WHERE sname="数据库"AND grade=(SELECT MAX(grade)FROM sc) D: SELECT sno FROM sc FOR sname="数据库"OR grade=(SELECT MAX(grade)FROM s