• 2022-05-28
    SQL语句:select distinct sdept from student 实现了关系代数中的()操作。
    A: 选择
    B: 投影
    C: 连接
    D: 除
  • B

    内容

    • 0

      查询student表中的gender字段(gender代表性别),使其查询记录中不能出现重复值的SQL语句是(1.0分) A: SELECT gender FROM student; B: SELECT DISTINCT * FROM student; C: SELECT DISTINCT gender FROM student; D: SELECT * FROM student;

    • 1

      在学生选课数据库中,查询选修了课程的学生的学号、姓名,SQL语句可为( ) A: SELECT DISTINCT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; B: SELECT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; C: SELECT DISTINCT Sno, DISTINCT Sname FROM Student WHERE Student.Sno IN (SELECT Sno FROM SC); D: SELECT Sno, Sname FROM Student WHERE Student.Sno IN (SELECT DISTINCT Sno FROM SC);

    • 2

      对关系R(A, B, C)执行SQL语句 SELECT DISTINCT A FROM R WHERE B=17 则该语句对关系R进行了() A: 选择和连接 B: 选择和投影 C: 连接和投影 D: 交和选择

    • 3

      S_T数据库关系图如下:[img=332x128]17e448fc85e997f.jpg[/img]查询与“刘晨”在同一个系学习的学生,要求显示学生学号(Sno)、姓名(Sname)及系别(Sdept)。下列SQL语句正确的是()。 A: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept = (SELECT Sdept FROM Student WHERE Sname = '刘晨'); B: SELECT S1.Sno, S1.Sname , S1.Sdept FROM Student S1 , Student S2 WHERE S1.Sdept = S2.Sdept AND S2.Sname = '刘晨'; C: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept IN (SELECT Sdept FROM Student WHERE Sname = '刘晨'); D: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept LIKE (SELECT Sdept FROM Student WHERE Sname = '刘晨');

    • 4

      在关系数据库中,SQL提供的SELECT查询语句基本形式为: SELECT A1, A2, …, An FROM R1, R2, …, Rm [WHERE F] 其中SELECT、FROM和WHERE子句分别对应于二维表的______操作。 A: 连接操作,选择操作,投影操作 B: 投影操作,连接操作,选择操作 C: 选择操作,投影操作,连接操作 D: 投影操作,选择操作,连接操作