A: SELECT AVG(Grade)FROM SCWHERE Cno= ' 1 '
B: SELECT MAX(Grade)FROM SCWHERE Cno= 1
C: SELECT MIN(Grade)FROM SCWHERE Cno= 1
D: SELECT AVG(Grade)FROM SCWHERE Cno= 1
举一反三
- 针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下( )语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select sno from scwhere grade>90group by snohaving count(cno)>2 B: select sno from scwhere grade>90group by snohaving count(*)>2 C: select sno from scwhere grade>90 and count(*)>2group by sno D: select sno from scwhere grade>90group by snohaving count(sno)>2
- 查询没有选修1号课程的学生姓名()。 A: select snamefrom student,scwhere student.sno=sc.sno and cno!='1' B: select snamefrom sno not in(select snofrom scwhere cno='1' ) C: select snamefrom sno in(select snofrom scwhere cno!='1' ) D: select snamefrom sno not exists(select*from scwhere student.sno and sc.sno and cno='1' )
- 下列SQL语句中,________可以在“学生-课程”数据库中实现“查询所有有成绩的学生学号和课程号”。 A: SELECT Sno,Cno FROM SC WHERE Grade <> NULL B: SELECT Sno,Cno FROM SC WHERE Grade NOT NULL C: SELECT Sno,Cno FROM SC WHERE Grade >0 D: SELECT Sno,Cno FROM SC WHERE Grade IS NOT NULL
- 针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下()语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select snofrom scwhere grade>;90group by snohaving count(cno)>;2 B: select snofrom scwhere grade>;90group by snohaving count(*)>;2 C: select snofrom scwhere grade>;90 and count(*)>;2group by sno D: select snofrom scwhere grade>;90group by snohaving count(distinct sno)>;2
- 检索选修了课程”C1”的学生中成绩最高的学生的学号,正确的SELECT语句为( ) A: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE >=ALL (SELECT Grade FROM SC WHERE Cno=’C1’); B: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE IN (SELECT Grade FROM SC WHERE Cno=’C1’); C: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE > ANY (SELECT Grade FROM SC WHERE Cno=’C1’); D: SELECT Sno FROM SC WHERE Cno=’C1’ AND GRADE >= (SELECT Grade FROM SC WHERE Cno=’C1’);
内容
- 0
下列SQL语句中,_________可以在“学生-课程”数据库正确实现“查询所有选修了1号课程的学生姓名”。 A: SELECT SnameFROM Student, SCWHERE SC.Cno= '1' B: SELECT SnameFROM Student, SCWHERE Student.Sno=SC.Sno AND SC.Cno= 1 C: SELECT Sname FROM Student WHERE Sno= (SELECT Sno FROM SC WHERE Cno= '1') D: SELECT Sname FROM Student WHERE EXISTS (SELECT * FROM SC WHERE Sno=Student.Sno AND Cno= '1')
- 1
查询所有有成绩的学生学号和课程号。正确的SELECT语句是()。 A: Select sno , cno from sc where grade < > null B: Select sno as 学号, cno as 课程号 from sc where grade is not null C: Select sno , cno from sc where grade !=‘ ’ D: Select sno , cno from sc where grade is not null
- 2
针对S_T数据库,查询既选修了1号课程又选修3号课程的学生学号,以下不正确的SQL命令是( )。 A: select snofrom scwhere cno='1' and cno='3' B: select snofrom scwhere cno='1'intersectselect snofrom scwhere cno='3' C: select snofrom scwhere cno='1' and sno in(select snofrom scwhere cno='3') D: select a.snofrom sc a,sc bwhere a.sno=b.sno and a.cno='1' and b.cno='3'
- 3
学生表S、课程表C和学生选课表SC,它们的结构如下: S(S#,SN,SEX,AGE,DEPT)C(C#,CN)SC(S#,C#,GRADE) 其中,S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号,CN为课程名,GRADE为成绩。查询选修课程“C2”的学生中成绩最高的学生的学号。正确的SELECT语句是 A: SELECT S B: FROM SCWHERE C C: =“C2” AND GRADE >= (SELECT GRADE FROM SCWHERE C D: =“C2”) E: SELECT S F: FROM SCWHERE C G: =“C2” AND GRADE IN (SELECT MAX(GRADE) FROM SCWHERE C H: =“C2”) I: SELECT S J: FROM SCWHERE C K: =“C2” AND GRADE IN (SELECT GRADE FROM SCWHERE C L: =“C2”) M: SELECT S N: FROM SCWHERE C O: =“C2” AND GRADE > ALL (SELECT GRADE FROM SCWHERE C P: =“C2”)
- 4
下列SQL语句中,________可以在“学生-课程”数据库中实现“查询所有有成绩的学生学号和课程号”。 A: SELECT Sno,CnoFROM SCWHERE Grade NOT NULL B: SELECT Sno,CnoFROM SCWHERE Grade <> NULL C: SELECT Sno,CnoFROM SCWHERE Grade IS NOT NULL D: SELECT Sno,CnoFROM SCWHERE Grade >0