nerdexam
Oracle

1Z0-047 · Question #153

View the Exhibit and examine the description of the EMPLOYEES table. You want to display the EMPLOYE_ID, FIRST_NAME, and DEPARTMEN_ID for all the employees who work in the same department and have…

The correct answer is D. The columns in the WHERE clause condition of the main query and the columns selected in the subquery. See the full explanation below for the reasoning.

Question

View the Exhibit and examine the description of the EMPLOYEES table. You want to display the EMPLOYE_ID, FIRST_NAME, and DEPARTMEN_ID for all the employees who work in the same department and have the same manager as that of the employee having EMPLOYE_ID 104. To accomplish the task, you execute the following SQL statement:

SELECT employee_id, first_name, department_id FROM employees WHERE (manager_id, department_id) =(SELECT department_id, manager_id FROM employees WHERE employee_id = 104) AND employee_id <> 104; When you execute the statement it does not produce the desired output. What is the reason for this?

Options

  • AThe WHERE clause condition in the main query is using the = comparison operator, instead of EXISTS.
  • BThe WHERE clause condition in the main query is using the = comparison operator, instead of the IN
  • CThe WHERE clause condition in the main query is using the = comparison operator, instead of the = ANY
  • DThe columns in the WHERE clause condition of the main query and the columns selected in the subquery

How the community answered

(39 responses)
  • A
    3% (1)
  • B
    8% (3)
  • C
    13% (5)
  • D
    77% (30)

Community Discussion

No community discussion yet for this question.

Full 1Z0-047 Practice