设有一个学生选课数据库,其包括学生表S、课程表C和学生选课表SC三个关系:S(SNO, SNAME, SAGE, SDEP);C(CNO, CNAME);SC(SNO, CNO, GRADE)。其中S

12 查阅

设有一个学生选课数据库,其包括学生表S、课程表C和学生选课表SC三个关系:S(SNO, SNAME, SAGE, SDEP);C(CNO, CNAME);SC(SNO, CNO, GRADE)。其中SNO是学生号,SNAME是学生姓名,SAGE是年龄, SDEP是学生所在系,CNO是课程号,CNAME是课程名称。 “查询计算机科学系年龄介于15岁至19岁之间的学生”,其SQL语句为()。

A.SELECT * FROM S WHERE SDEP = ‘CS’ AND SAGE BETWEEN 15 AND 19;

B.SELECT * FROM S WHERE SDEP = ‘CS’ AND SAGE <= 19 AND SAGE >= 15;

C.SELECT * FROM S WHERE SDEP = ‘CS’ OR SAGE BETWEEN 15 AND 19;

D.SELECT * FROM S WHERE SDEP = ‘CS’ AND SAGE <= 19 OR SAGE >= 15;

参考答案:

答案:SELECT * FROM S WHERE SDEP = ‘CS’ AND SAGE BETWEEN 15 AND 19;;SELECT * FROM S WHERE SDEP = ‘CS’ AND SAGE <= 19 AND SAGE >= 15;