多选题Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10,40) ORSER BY dept_name; The statement fails when executed. Which change fixes the error?()Aremove the

题目
多选题
Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (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

参考答案和解析
正确答案: F,A
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You need to create a view EMP_VU. The view should allow the users to manipulate the records of only the employees that are working for departments 10 or 20. Which SQL statement would you use to create the view EMP_VU? ()

A. CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department _ id IN (10,20);

B. CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH READ ONLY;

C. CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH CHECK OPTION;

D. CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WITH department_id IN (10,20);

E. CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;


参考答案:C

第2题:

Examine the data in the EMPLOYEES and DEPARTMENTS tables:Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:On the EMPLOYEES table, EMPLOYEE_ID is the primary key.MGR_ID is the ID of managers and refers to the EMPLOYEE_ID.DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table.On the DEPARTMENTS table, DEPARTMENT_ID is the primary key.Examine this DELETE statement:What happens when you execute the DELETE statement?()

A. Only the row with department ID 40 is deleted in the DEPARTMENTS table.

B. The statement fails because there are child records in the EMPLOYEES table with department ID 40.

C. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.

D. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.

E. The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.

F. The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.


参考答案:B

第3题:

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

第4题:

Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables.You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()

  • A、SELECT last_name, department_name FROM employees NATURAL JOIN departments;
  • B、SELECT last_name, department_name FROM employees JOIN departments ;
  • C、SELECT last_name, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id);
  • D、SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);
  • E、SELECT last_name, department_name FROM employees FULL JOIN departments ON (e.department_id = d.department_id);
  • F、SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);

正确答案:F

第5题:

Evaluate this SQL statement: SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT statement are performed?()

  • A、Selection, projection, join
  • B、Difference, projection, join
  • C、Selection, intersection, join
  • D、Intersection, projection, join
  • E、Difference, projection, product

正确答案:A

第6题:

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:Evaluate this SQL statement:Which SQL statement is equivalent to the above SQL statement?()

A.

B.

C.

D.


参考答案:C

第7题:

Evaluate this SQL statement:SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAMEFROM EMPLOYEES e, DEPARTMENTS dWHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID;In the statement, which capabilities of a SELECT statement are performed?()

A.selection, projection, join

B.difference, projection, join

C.selection, intersection, join

D.intersection, projection, join

E.difference, projection, product


参考答案:A

第8题:

Evaluate this SQL statement: SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d.DEPARTMENT_NAME FROM EMP e, DEPARTMENT d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT statement are performed?()

A. Selection, projection, join

B. Difference, projection, join

C. Selection, intersection, join

D. Intersection, projection, join

E. Difference, projection, product


参考答案:A

第9题:

You need to create a view EMP_VU. The view should allow the users to manipulate the records of only the employees that are working for departments 10 or 20.Which SQL statement would you use to create the view EMP_VU?()

  • A、CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20);
  • B、CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH READ ONLY;
  • C、CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH CHECK OPTION;
  • D、CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20);
  • E、CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;

正确答案:C

第10题:

Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement? ()

  • A、SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);
  • B、SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;
  • C、SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;
  • D、SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

正确答案:C

更多相关问题