nerdexam
Oracle

1Z0-061 · Question #215

EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEPARTMENTS On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table…

The correct answer is D. The statement fails because there is more than one row matching the employee name Smith. '=' is use in the statement and sub query will return more than one row. Employees table has 2 row matching the employee name Smith. The update statement will fail.

Manipulating Data

Question

EMPLOYEES and DEPARTMENTS data:

EMPLOYEES DEPARTMENTS On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = . (SELECT mgr_id . FROM. employees . WHERE dept_id= . (SELECT department_id . FROM departments . WHERE department_name = 'Administration')), . Salary = (SELECT salary . . FROM employees . . WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed?

Exhibits

1Z0-061 question #215 exhibit 1
1Z0-061 question #215 exhibit 2

Options

  • AThe statement executes successfully, leaves the manager ID as the existing value, and changes
  • BThe statement executes successfully, changes the manager ID to NULL, and changes the salary
  • CThe statement executes successfully, changes the manager ID to NULL, and changes the salary
  • DThe statement fails because there is more than one row matching the employee name Smith.
  • EThe statement fails because there is more than one row matching the IT_ADMIN job ID in the
  • FThe statement fails because there is no 'Administration' department in the DEPARTMENTS table.

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    3% (1)
  • D
    83% (25)
  • E
    10% (3)

Explanation

'=' is use in the statement and sub query will return more than one row. Employees table has 2 row matching the employee name Smith. The update statement will fail.

Topics

#UPDATE statement#correlated subquery#DML#NULL handling

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice