下列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
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
举一反三
- 选择题:在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: 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';
- 请把下面代码补充完整。( ) 查询年龄在20~23岁(包括20岁和23岁)之间的学生的姓名、系别和年龄。 SELECT Sname, Sdept, Sage FROM Student WHERE Sage 20 23; A: BETWEEN……AND B: LIKE C: =,<= D: ,
- 请把下面代码补充完整。( ) 查询年龄在20~23岁(包括20岁和23岁)之间的学生的姓名、系别和年龄。 SELECT Sname, Sdept, Sage FROM Student WHERE Sage 20 23; A: BETWEEN……AND B: LIKE C: >=,<= D: >,<