従業員と部門のデータ: 従業員 部門 EMPLOYEESテーブルでは、EMPLOYEE_IDが主キーです。 MGR_IDはIDマネージャーであり、EMPLOYEE_IDを参照します。 DEPARTMENTSテーブルでは、DEPARTMENT_IDが主キーです。 このUPDATEステートメントを評価します。 従業員の更新 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'; ステートメントが実行されるとどうなりますか?
正解:D
'=' 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. Incorrect Answers : A: The Update statement will fail no update was done. B: The update statement will fail no update was done. C: The update statement will fail no update was done. E: The update statement will fail but not due to job_it='IT_ADMIN' F: The update statement will fail but not due to department_id='Administration' Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Sub queries, p. 6-12