• 2022-06-09
    表达条件“学生所在系不是计算机系(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: 以上都对
  • A,B,C,D

    举一反三

    内容

    • 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';