A: Sdept NOT IN('CS', 'MA', 'IS')
B: Sdept <> 'CS' ANDSdept <> 'MA' ANDSdept <> 'IS'
C: Sdept != 'CS' ANDSdept != 'MA' ANDSdept != 'IS'
D: 以上都对
举一反三
- 表达条件“学生所在系是计算机系(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: 以上说法都不对
- 查询所有非计算机系学生的信息,不正确的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 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';
内容
- 0
使用教学(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
- 1
对教材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'))
- 2
将所有计算机系学生的年龄增加1岁的正确语句是:( )。 A: UPDATE SET Student.Sage = Student .Sage + 1 WHERE Student.Sdept = 'CS'; B: UPDATE Student SET Sage + 1 WHERE Sdept = 'CS'; C: UPDATE Student SET Sage =Sage + 1 WHERE Sdept = 'CS'; D: UPDATE Student SET Sage += 1 WHERE Sdept = 'CS';
- 3
查询计算机系任意学生选修过的课程号,不正确的查询语句是: A: SELECT DISTINCT CnoFROM SCWHERE NOT EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SSno = Student.Sno); B: SELECT DISTINCT CnoFROM SCWHERE EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SSno = Student.Sno); C: SELECT DISTINCT CnoFROM SCWHERE Sno IN (SELECT SnoFROM StudentWHERE Sdept = 'CS'); D: SELECT DISTINCT CnoFROM SCLEFT JOIN StudentON SSno = Student.SnoWHERE Sdept = 'CS';
- 4
查询计算机系任意学生选修过的课程号,不正确的查询语句是: A: SELECT DISTINCT CnoFROM SCWHERE NOT EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SC.Sno = Student.Sno); B: SELECT DISTINCT CnoFROM SCWHERE EXISTS (SELECT SnoFROM StudentWHERE Sdept = 'CS'AND SC.Sno = Student.Sno); C: SELECT DISTINCT CnoFROM SCWHERE Sno IN (SELECT SnoFROM StudentWHERE Sdept = 'CS'); D: SELECT DISTINCT CnoFROM SCLEFT JOIN StudentON SC.Sno = Student.SnoWHERE Sdept = 'CS';