问题 单项选择题

对于教学数据库的三个基本表:S(Sno,Sname,Ssex),SC(Sno,Cno,Grade),C(Cno,Cname, Teacher),其中S为学生表,SC为学生选课表,C为课程表,则对于语句:检索至少选修LIU老师所授课课程中一门课程的女生姓名,SQL语句错误的是______。

A.SELECT Sname FROM S,SC,CWHERE Sno=SSno AND SCno=Cno AND Teacher=‘LIU’AND Ssex=‘F’

B.SELECT SnameFROM S WHERE Ssex=‘F’AND Sno IN (SELECT Sno FROM SC WHERE Cno IN(SELECT Cno FROM CWHERE Teacher=‘LIU’))

C.SELECT SnameFROM S WHERE Ssex=‘F’AND EXISTS (SELECT* FROM SC WHERE SSno=Sno AND EXISTS (SELECT* FROM C WHERE Teacher=‘LIU’))

D.SELECT Sname FROM S WHERE Ssex=‘F’AND EXISTS(SELECT* FROM SC WHERE SSno=Sno AND EXISTS (SELECT* FROM C WHERE Cno=SCno AND Teacher=‘LIU’))

答案

参考答案:C

单项选择题
名词解释