• 2022-10-26
    ‎下列SQL语句中,_____________可以在“学生-课程”数据库正确实现“查询选修2号课程且成绩在90分以上的所有学生的学号和姓名”。‏
    A: SELECT Sno, SnameFROM Student, SCWHERE Student.Sno = SC.Sno AND SC.Cno= ‘2’ AND SC.Grade > 90
    B: SELECT Student.Sno, SnameFROM Student, SCWHERE Student.Sno = SC.Sno AND SC.Grade > 90
    C: SELECT Sno, SnameFROM Student, SCWHERE SC.Cno= ‘2’ AND SC.Grade > 90
    D: SELECT Student.Sno, SnameFROM Student, SCWHERE Student.Sno = SC.Sno AND SC.Cno= ‘2’ AND SC.Grade > 90
  • D

    举一反三

    内容

    • 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

      查询没有选数据库基础课程的同学学号和姓名。select sno,sname from student where ____________(select ______ from sc ,course where _______________ and cname='数据库基础') A: not exists;* ; course.cno=sc.cno and student.sno=sno B: not exists;sno ; course.cno=sc.cno and student.sno=sc.sno C: sno not in ; sno ; course.cno=sc.cno D: sno not in ; * ; course.cno=sc.cno and student.sno=sc.sno

    • 2

      以下命令是相关子查询的嵌套查询是: 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: 以上都是

    • 3

      【多选题】针对学生选课数据库S_T,以下()操作实现了student表与sc之间的自然连接。 A. select student.* ,  cno,  grade  from student  join   sc  on  student.sno=sc.sno B. select student.* ,  sc.*  from student ,  sc  where student.sno=sc.sno C. select student.sno, sname, ssex, sage, sdept , cno, grade  from student ,  sc  where student.sno=sc.sno D. select student.* , cno, grade  from student ,  sc  where  student.sno=sc.sno

    • 4

      针对学生选课表sc(sno, cno, grade),其中sno为学号,cno为课程号,grade为成绩。以下( )语句可查询选修了两门以上成绩在90分以上课程的学生学号。 A: select sno from scwhere grade>90group by snohaving count(cno)>2 B: select sno from scwhere grade>90group by snohaving count(*)>2 C: select sno from scwhere grade>90 and count(*)>2group by sno D: select sno from scwhere grade>90group by snohaving count(sno)>2