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
举一反三
- 在学生选课数据库中,查询平均成绩大于等于60分的同学,SQL语句为( ) A: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno HAVING AVG(Grade)>=60; B: SELECT Sno FROM SC WHERE Grade>=60 GROUP BY Sno; C: SELECT Sno, Grade FROM SC GROUP BY Sno HAVING AVG(Grade)>=60; D: SELECT Sno FROM SC GROUP BY Sno HAVING Grade >=60;
- 查询最低成绩大于85分的学生学号和平均成绩,可以使用的查询语句是: 。 A: SELECT Sno, AVG(Grade) FROM SC HAVING MIN(Grade) > 85 GROUP BY Sno; B: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno HAVING MIN(Grade) > 85; C: SELECT Sno, AVG(Grade) FROM SC WHERE MIN(Grade) > 85 GROUP BY Sno; D: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno WHERE MIN(Grade) > 85;
- 表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
- 在学生选课数据库中,查询平均成绩大于等于60分的同学,SQL语句为( ) A: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno HAVING AVG(Grade)>=60; B: SELECT Sno FROM SC WHERE Grade>=60 GROUP BY Sno; C: SELECT Sno, Grade FROM SC GROUP BY Sno HAVING AVG(Grade)>=60; D: SELECT Sno FROM SC GROUP BY Sno HAVING Grade >=60;
- 已知关系模式:sc(sno,sname,grade),各属性含义依次为学号、课程名、分数。要查找“数据库”课分数最高的学生的学号,正确的SQL语句是( )。 A: SELECT sno FROM sc WHERE sname="数据库"AND grade=MAX(grad B: SELECT sno FROM sc FOR sname="数据库"OR grade>=MAX(grad C: SELECT sno FROM sc WHERE sname="数据库"AND grade=(SELECT MAX(grad FROM s D: SELECT sno FROM sc FOR sname="数据库"OR grade=(SELECT MAX(grad FROM s
内容
- 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