表达条件“学生所在系是计算机系(Sdept = 'CS')、数学系(Sdept = 'MA')和信息系(Sdept = 'IS')”,应该用()。
A: Sdept IN ('CS', 'MA', 'IS')
B: Sdept = 'CS' AND Sdept = 'MA' AND Sdept = 'IS'
C: Sdept = 'CS' OR Sdept = 'MA' OR Sdept = 'IS'
D: 以上说法都不对
A: Sdept IN ('CS', 'MA', 'IS')
B: Sdept = 'CS' AND Sdept = 'MA' AND Sdept = 'IS'
C: Sdept = 'CS' OR Sdept = 'MA' OR Sdept = 'IS'
D: 以上说法都不对
举一反三
- 表达条件“学生所在系不是计算机系(Sdept = 'CS')、数学系(Sdept = 'MA')和信息系(Sdept = 'IS')”,应该用 A: Sdept NOT IN('CS', 'MA', 'IS') B: Sdept <> 'CS' ANDSdept <> 'MA' ANDSdept <> 'IS' C: Sdept != 'CS' ANDSdept != 'MA' ANDSdept != 'IS' D: 以上都对
- 查询所有非计算机系学生的信息,不正确的SQL语句是:( ) A: SELECT * FROM Student WHERE Sdept != 'CS'; B: SELECT * FROM Student WHERE NOT Sdept = 'CS'; C: SELECT * FROM Student WHERE Sdept IN ('MA', 'IS'); D: SELECT * FROM Student WHERE NOT Sdept IN ('CS');
- 设学生关系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: 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';
- 使用教学(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