设学生关系Students(Sno,Sname,Sex,Sdept,Sage,Sadd),Sno、Sname、Sex、Sdept、Sage、Sadd分别表示学生的学号、姓名、性别、所在系、年龄和住址。查询比计算机系(CS)所有学生年龄都小于其他系的学生姓名及年龄的SQL语句为: SELECT Sname,Sage FROM Students WHERE Sage ______ (SELECT Sage FROM Students WHERE ______) A.Sdept=’CS’ B.Sdept<>’CS’ C.’Sdept’=CS D.’Sdept’<>CS
A: AND Sdept<>’CS’;
A: AND Sdept<>’CS’;
举一反三
- 设学生关系Students(Sno,Sname,Sex,Sdept,Sage,Sadd),Sno、Sname、Sex、Sdept、Sage、Sadd分别表示学生的学号、姓名、性别、所在系、年龄和住址。查询比计算机系(CS)所有学生年龄都小于其他系的学生姓名及年龄的SQL语句为:SELECT Sname,SageFROM StudentsWHERE Sage ______(SELECT SageFROM StudentsWHERE ______)AND Sdept<>"CS"; A: <MAX B: >MIN C: <ALL D: <ANY
- 设学生关系为Students(Sno,Sname,Sex,Sdept,Sage,Sadd),其中Sno、Sname、Sex、Sdept、Sage、Sadd分别表示学生的学号、姓名、性别、所在系、年龄和住址。查询比计算机系(CS)所有学生年龄都小的其他系的学生姓名及年龄的SQL语句为:SELECT Sname, SageFROM StudentsWHERE Sage (61) (SELECT SageFROM StudentsWHERE (62) )AND Sdept<>’CS’; (61)处填()。 A: <MAX B: >MIN C: <ALL D: <ANY
- 在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: 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);
- 对教材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'))