• 2022-06-09
    下列 SQL 语句select * from student where sno = '05880101'union select * from student where sno = '05880102'与此查询语句等价的选项是( )。
    A: select * from student where sno= '05880101' and sno= '05880102'
    B: select * from student where sno= '05880101' or sno= '05880102'
    C: select * from student where sno= '05880101'
    D: select * from student where sno= '05880102'
  • B

    举一反三

    内容

    • 0

      下列查询中,属于相关子查询的有()。 A: SELECT * FROM student WHERE sno IN (SELECT sno FROM sc WHERE cno='1'); B: SELECT sno, cno FROM SC x WEHRE grade>=(SELECT AVG(grade) FROM SC y WHERE y.sno = x.sno); C: SELECT sname FROM student WHERE EXISTS(SELECT * FROM sc WHERE sno=student.sno AND cno='1'); D: SELECT sname FROM student WHERE NOT EXISTS(SELECT * FROM course WHERE NOT EXISTS(SELECT * FROM sc WHERE sc.sno=student.sno AND sc.cno=course.cno));

    • 1

      如果有学生表student,sno代表学号,sage代表年龄,则想要得到年龄在18到20之间的学生学号的SQL语句是() A: SELECT sno<br/>FROM student<br/>WHERE sage&gt;18 or sage&lt;20 B: SELECT sno<br/>FROM student<br/>WHERE sage=18 C: SELECT sno<br/>FROM student<br/>WHERE sage in (18,20) D: SELECT sno<br/>FROM student<br/>WHERE sage between18 and 20

    • 2

      对于学生信息表:student(sno,sname,sex,age,dept),能够得到年龄在20岁至22岁之间的学生的姓名和学号的语句是( )。 A: SELECT*FROM student WHERE age BETWEEN 20 AND 22 B: SELECT sname,sno FROM student WHERE age BETWEEN 20 AND 22 C: SELECT sname,sno FROM student WHERE age>=20 D: SELECT sname,sno FROM student WHERE age<=22

    • 3

      查询选修1号课程的学生姓名的sql语句为: select sname from student where sno = (select sno from sc where cno=1);

    • 4

      以下命令是相关子查询的嵌套查询是: A: SELECT * FROM student WHERE sno IN (SELECT sno FROM sc WHERE cno = '1') B: SELECT * FROM student WHERE EXISTS (SELECT * FROM sc WHERE cno = '1' AND sc.sno = student.sno) C: SELECT sno, cno FROM sc x WHERE grade>(SELECT AVG(grade) FROM sc y WHERE y.sno = x.sno) D: 以上都是