QuestionQ266

VerifiedDisplaying Data from Multiple Tables

Examine the description of the EMPLOYEES table:

Question Image

Which two queries return rows for employees whose managers work in a different department?

Choose two
Explanation

A self-join that matches emp.manager_id to mgr.employee_id and requires unequal department IDs returns employees whose manager is in another department. An inner join with those predicates does this directly. A right join with the same predicates followed by emp.employee_id IS NOT NULL removes unmatched right-side rows, producing the same matching employee rows. Oracle documents that inner joins return only rows satisfying the join condition, while outer joins retain unmatched rows from one side.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!