选择题:在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是:
A: SELECT SnameFROM StudentWHERE Sage > (SELECT AVG(Sage)FROM Student);WHERE Sdept = 'CS'
B: SELECT SnameFROM StudentWHERE Sage > AVG(SELECT SageFROM StudentWHERE Sdept = 'CS');
C: SELECT SnameFROM StudentWHERE Sage > (SELECT AVG(Sage)FROM StudentWHERE Sdept = 'CS');
D: SELECT SnameFROM StudentWHERE AVG(Sage) > (SELECT SageFROM StudentWHERE Sdept = 'CS');
A: SELECT SnameFROM StudentWHERE Sage > (SELECT AVG(Sage)FROM Student);WHERE Sdept = 'CS'
B: SELECT SnameFROM StudentWHERE Sage > AVG(SELECT SageFROM StudentWHERE Sdept = 'CS');
C: SELECT SnameFROM StudentWHERE Sage > (SELECT AVG(Sage)FROM StudentWHERE Sdept = 'CS');
D: SELECT SnameFROM StudentWHERE AVG(Sage) > (SELECT SageFROM StudentWHERE Sdept = 'CS');
举一反三
- 选择题:在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: A: SELECT SnameFROM StudentWHERE Sage >; (SELECT AVG(Sage)FROM Student);WHERE Sdept = 'CS' B: SELECT SnameFROM StudentWHERE Sage >; AVG(SELECT SageFROM StudentWHERE Sdept = 'CS'); C: SELECT SnameFROM StudentWHERE Sage >; (SELECT AVG(Sage)FROM StudentWHERE Sdept = 'CS'); D: SELECT SnameFROM StudentWHERE AVG(Sage) >; (SELECT SageFROM StudentWHERE Sdept = 'CS');
- 查询非计算机系中比计算机系中年龄最小者年龄大或相等的学生姓名,不正确的查询语句是: A: SELECT SnameFROM Student S1WHERE NOT EXISTS (SELECT *FROM Student S2WHERE S2.Sdept = 'CS'AND S1.Sage ;= S2.Sage)AND Sdept != 'CS'; B: SELECT SnameFROM StudentWHERE Sage >;= (SELECT MIN(Sage) FROMStudentWHERE Sdept = 'CS')AND Sdept != 'CS'; C: SELECT SnameFROM StudentWHERE Sage >;= ANY (SELECT SageFROM StudentWHERE Sdept = 'CS')AND Sdept != 'CS';
- 在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: A: SELECT Sname FROM Student WHERE Sage > ( SELECT AVG(Sage) FROM Student ); WHERE Sdept = 'CS' B: SELECT Sname FROM Student WHERE Sage > AVG( SELECT Sage FROM Student WHERE Sdept = 'CS' ); C: SELECT Sname FROM Student WHERE Sage > ( SELECT AVG(Sage) FROM Student WHERE Sdept = 'CS' ); D: SELECT Sname FROM Student WHERE AVG(Sage) > ( SELECT Sage FROM Student WHERE Sdept = 'CS' );
- 下列SQL语句,_____________可以在“学生-课程”数据库正确实现“查询年龄在20-23岁(包括20岁和23岁)之间的学生的姓名、系别和年龄”。 A: SELECT Sname,Sdept,SageFROM StudentWHERE Sage BETWEEN 20 AND 23 B: SELECT Sname,Sdept,SageFROM StudentWHERE Sage 20 AND 23 C: SELECT Sname,Sdept,SageFROM StudentWHERE Sage >=20 AND <=23 D: SELECT Sname,Sdept,SageFROM StudentWHERE Sage NOT BETWEEN 20 AND 23
- 计算机系年龄最大的学生的信息select *from studentwhere __________________________________ A: sdept='计算机系' and sage=(select max(sage) from student where sdept='计算机系') B: sdept='计算机系' and sage=max(sage) C: sdept='计算机系' or sage=(select max(sage) from student ) D: sdept='计算机系' or sage=max(sage)