• 2022-06-07
    有关系S(SNO, SNAME, SAGE),C(CNO, CNAME),SC(SNO, CNO, GRADE)。其中SNO是学生号,SNAME是学生姓名,SAGE是学生年龄, CNO是课程号,CNAME是课程名称,GRADE是成绩。以下( )SQL语句可以实现查询选修了'C002'号课程的学生姓名。
    A: SELECT SNAME FROM S, SC WHERE S.SNO=SC.SNO AND CNO='C002'
    B: SELECT SNAME FROM S WHERE SNO IN (SELECT SNO FROM SC WHERE CNO='C002')
    C: SELECT SNAME FROM S WHERE SNO = (SELECT SNO FROM SC WHERE CNO='C002')
    D: SELECT SNAME FROM S WHERE SNO NOT IN (SELECT SNO FROM SC WHERE CNO='C002')
  • 举一反三