“查询与‘刘晨’在同一个系学习的学生”的SQL语句为()。


“查询与‘刘晨’在同一个系学习的学生”的SQL语句为()。

A.SELECT SNO, SNAME, SAGE, SSEX, SDEP FROM S()WHERE SDEP IN(SELECT SDEP()FROM S WHERE SNAME = '刘晨');

B.SELECT * FROM S WHERE SDEP IN(SELECT SDEP()FROM S WHERE SNAME ='刘晨');

C.SELECT SNO, SNAME, SAGE, SSEX, SDEP FROM S WHERE SNAME = '刘晨';

D.SELECT S1.SNO, S1.SNAME, S1.SAGE, S1.SSEX, S1.SDEP FROM S S1, S S2()WHERE S1.SDEPT = S2.SDEPT AND S2.SNAME = '刘晨';

正确答案:SELECT SNO, SNAME, SAGE, SSEX, SDEP FROM S()WHERE SDEP IN(SELECT SDEP()FROM S WHERE SNAME = '刘晨');;SELECT * FROM S WHERE SDEP IN(SELECT SDEP()FROM S WHERE SNAME ='刘晨');;SELECT S1.SNO, S1.SNAME, S1.SAGE, S1.SSEX, S1.SDEP FROM S S1, S S2()WHERE S1.SDEPT = S2.SDEPT AND S2.SNAME = '刘晨';


Tag:数据库系统概论 语句 学生 时间:2022-01-29 19:41:07