Evaluate this SQL statement:SELECT e.emp_name, d.dept_nameFROM employees eJOIN departments dUSING (department_id)WHERE d.department_id NOT IN (10,40)ORSER BY dept_name;The statement fails when executed. Which change fixes the error? ()A. remove the ORDER

题目

Evaluate this SQL statement:SELECT e.emp_name, d.dept_nameFROM employees eJOIN departments dUSING (department_id)WHERE d.department_id NOT IN (10,40)ORSER BY dept_name;The statement fails when executed. Which change fixes the error? ()

A. remove the ORDER BY clause

B. remove the table alias prefix from the WHERE clause

C. remove the table alias from the SELECT clause

D. prefix the column in the USING clause with the table alias

E. prefix the column in the ORDER BY clause with the table alias

F. replace the condition "d.department_id NOT IN (10,40)" in the WHERE clause with "d.department_id <> 10 AND d.department_id <> 40"


相似考题
参考答案和解析
参考答案:C
更多“Evaluate this SQL statement:SELECT e.emp_name, d.dept_nameFROM employees eJOIN departments ”相关问题
  • 第1题:

    已知关系模式R的全部属性集U={A,B,C,D,E,G}及函数依赖集:

    F=(AB→C,C→A,BC→D,ACD→B,D→EG,BE→C,CG→BD,CE→AG}求属性集闭包(BD)+

    (2) 现有如下两个关系模式:

    Employees(Eid,Name,DeptNO)

    Departments(DeptNO,DeptName,TotalNumber)

    Employees关系模式描述了职工编号、姓名和所在部门编号;Departments关系模式描述了部门编号、名称和职工总


    正确答案:(BD)+=ABCDEG X(O)=BD;由D→EG可知X(1) =BDEG;再由BE→C可知X(2)→BDEGC;又有CG→BDCE→AG可知X(3)=BDEGCA因为X(3)中包含了所有的属性集即有(BD)+=X(3)=ABCDEG T—C(TNO.CNO)主码(TNOCNO)外码TNOCNO S—C(SNOCNO成绩)主码(SNOCNO).外码SNOCNO (2) create trigger sql_tri on employees for
    (BD)+=ABCDEG X(O)=BD;由D→EG可知X(1) =BDEG;再由BE→C,可知X(2)→BDEGC;又有CG→BD,CE→AG,可知X(3)=BDEGCA,因为X(3)中包含了所有的属性集,即有(BD)+=X(3)=ABCDEG T—C(TNO.CNO)主码(TNO,CNO),外码TNO,CNO S—C(SNO,CNO,成绩)主码(SNO,CNO).外码SNO,CNO (2) create trigger sql_tri on employees for 解析:本题考查了后触发器的Transact—SQL语句。其语法格式为:
    CREATE TRIGGER触发器名称
    0N |表名|视图名|
    [WITH ENCRYPTION]
    AS
    SQL语句
    AFTER和FOR,指定触发器只有在引发的SQL语句中指定的操作都已成功执行,并且所有的约束检查也成功完成后,才执行此触发器,即后触发型触发器。

  • 第2题:

    7、Statement对象提供了执行基本SQL语句的功能。


    正确

  • 第3题:

    Statement对象本身包含SQL语句。


    错误

  • 第4题:

    下列选项中,关于Statement描述错误的是()

    A.Statement是用来执行SQL语句的

    B.Statement是PreparedStatement的子接口

    C.获取Statement实现需要使用Connection的createStatement()方法

    D.PreparedStatement能使用参数占位符,而Statement不行


    Statement是PreparedStatement的子接口

  • 第5题:

    下列选项中,关于Statement描述错误的是()

    A.Statement是用来执行SQL语句的

    B.Statement是PreparedStatement的子接口

    C.获取Statement实现需要使用Connection的createStatement()方法

    D.PreparedStatement能使用参数占位符,而Statement不行


    Statement是PreparedStatement的子接口

  • 第6题:

    3.下列选项中,关于Statement描述错误的是() A: Statement是用来执行SQL语句的 B: Statement是PreparedStatement的子接口 C: 获取Statement实现需要使用Connection的createStatement()方法 D: PreparedStatement能使用参数占位符,而Statement不行

    A.A B C D

    B.A B C D

    C.A B C D

    D.A B C D


    Statement 是 PreparedStatement 的子接口