nerdexam
Oracle

1Z0-047 · Question #102

View the Exhibit and examine the description of the EMPLOYEES and DEPARTMENTS tables. You want to display the LAST_NAME for the employees, LAST_NAME for the manager of the employees, and the…

The correct answer is C. The statement would not execute because the WHERE clause is wrongly placed. See the full explanation below for the reasoning.

Question

View the Exhibit and examine the description of the EMPLOYEES and DEPARTMENTS tables. You want to display the LAST_NAME for the employees, LAST_NAME for the manager of the employees, and the DEPARTMENT_NAME for the employees having 100 as MANAGER_ID. The following SQL statement was written:

SELECT m.last_name "Manager", e.last_name "Employee", department_name "Department" FROM employees m JOIN employees e ON (m.employee_id = e.manager_id) WHERE e.manager_id=100 JOIN departments d ON (e.department_id = d.department_id); Which statement is true regarding the output of this SQL statement?

Exhibit

1Z0-047 question #102 exhibit

Options

  • AThe statement would provide the desired results.
  • BThe statement would not execute because the ON clause is written twice.
  • CThe statement would not execute because the WHERE clause is wrongly placed.
  • DThe statement would not execute because the self join uses the ON clause instead of the USING clause.

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    70% (14)
  • D
    20% (4)

Community Discussion

No community discussion yet for this question.

Full 1Z0-047 Practice