Update employees set departmentid changedept10

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: date to the EMPLOYEES table? A. UPDATE departments SET department_id = change_dept(10, 'Finance') Where dapartment_id=10; B. UPDATE employees SET department_id = change_dept(10, 'Finance') Where dapartment_id=10; C. UPDATE departments change_dept(270, 'Outsource') Where dapartment_name='payroll'; D. UPDATE employees SET department_id = change_dept(10, 'Finance') WHERE department_id = DEPARTMENTS:CURRVAl; Answer: B Explanation: This statement updates the Department_id of the Employees with department_id 10 to the next sequence number. The Update Statement invokes the change_dept function in the set statement and passes the Current department_id & the New Department Name as input parameters. The Function gets the next Department ID from the Sequence and successfully updates the Department & Department Name based on the parameters passed to the function. Incorrect Answers A. This statement will not update the Employees Table. The Statement would attempt to update the Departments table will it would generate an error due to a mutating table. C. This Statement attempts to update the wrong table, has incorrect syntax and if corrected would result in an error due to a mutating table. D. This is not a valid sequence. You can't have a sequence with the same name as a table and if you tried to use the CURRVAL of the departments_seq.nextval sequence in the WHERE you would get the following error: QUESTION 106: Actualtests.com - The Power of Knowing 1Z0-147 Which two statements about object dependencies are accurate? (Choose two.) A. When referencing a package procedure or function from a stand-alone procedure or function, if the package specification changes, the package body remains valid but the stand-alone procedure becomes invalid B. When referencing a package procedure or function from a stand-alone procedure or function, if the package body changes and the package specification does not change, the stand-alone procedure referencing a package construct remains valid. C. When referencing a package procedure or function from a stand-alone procedure or function, if the package body ch...
View Full Document

This document was uploaded on 03/08/2014.

Ask a homework question - tutors are online