nerdexam
Oracle

1Z0-071 · Question #228

Examine the structure of the employees table: There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID. You want to display the name, joining date, and manager for all the employees…

The correct answer is B. SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager FROM employees e. We should use LEFT OUTER JOIN as we want to display employees which have no (have NULL values for) managers.

Displaying Data from Multiple Tables Using Joins

Question

Examine the structure of the employees table:

There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID. You want to display the name, joining date, and manager for all the employees. Newly hired employees are yet to be assigned a department or a manager. For them, 'No Manager1 should be displayed in the manager column. Which SQL query gets the required output?

Exhibit

1Z0-071 question #228 exhibit

Options

  • ASELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager FROM employees e
  • BSELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager FROM employees e
  • CSELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager FROM employees e
  • DSELECT e.last_name/ e.hire_date/ NVL(m.last_______ name/ 'No Manager') Manager FROM

How the community answered

(59 responses)
  • A
    10% (6)
  • B
    83% (49)
  • C
    5% (3)
  • D
    2% (1)

Explanation

We should use LEFT OUTER JOIN as we want to display employees which have no (have NULL values for) managers.

Topics

#self join#NVL#outer join#hierarchical data

Community Discussion

No community discussion yet for this question.

Full 1Z0-071 Practice