查询非计算机科学系中比计算机科学系所有学生年龄都小的学生姓名及年龄。 SELECT Sname,Sage FROM Student WHERE Sage [ ALL (SELECT Sage FROM Student WHERE Sdept= 'CS' ) AND Sdept <] ' CS '; 其中的Sage < ALL等价于?
A: MIN(Sage)
B: MAX(Sage)
C: MIN(Sage)
D: MAX(Sage)
A: MIN(Sage)
B: MAX(Sage)
C: MIN(Sage)
D: MAX(Sage)
举一反三
- 对教材79页学生表的查询,若描述条件‘年龄大于计算机系某个学生的年龄’,可以表示为: A: WHERE sage>ANY(SELECT sage FROM student WHERE sdept='CS') B: WHERE sage>SOME(SELECT sage FROM student WHERE sdept='CS') C: WHERE sage>ALL(SELECT sage FROM student WHERE sdept='CS') D: WHERE sage>(SELECT MIN(sage) FROM student WHERE 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' );
- 在所有学生中查询比计算机系所有学生年龄都要大的学生姓名,正确的查询语句是___________________。 A: SELECT Sname FROM Student WHERE Sage > ( SELECT MAX(Sage) FROM Student WHERE Sdept = 'CS'); B: SELECT Sname FROM Student WHERE Sage > ALL ( SELECT Sage FROM Student WHERE Sdept = 'CS'); C: SELECT Sname FROM Student S1 WHERE EXISTS ( SELECT Sage FROM Student S2 WHERE Sdept = 'CS' AND S1.Sage > S2.Sage); D: SELECT Sname FROM Student S1 WHERE NOT EXISTS ( SELECT * FROM Student S2 WHERE Sdept = 'CS' AND S1.Sage <= S2.Sage);
- 计算机系年龄最大的学生的信息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)
- 使用教学(STC)数据库,与如下查询语句等价的是( )。 SELECT *FROM Student WHERE Sdept = 'CS' EXCEPT SELECT * FROM Student WHERE Sage <= 19; A: SELECT * FROM Student WHERE Sdept = 'CS' AND Sage > 19 B: SELECT * FROM Student WHERE Sdept = 'CS' AND Sage <= 19 C: SELECT * FROM Student WHERE Sdept = 'CS' OR Sage <= 19 D: SELECT * FROM Student WHERE Sdept = 'CS' OR Sage > 19