Create save and execute a procedure which updates the salary of employees in

Create save and execute a procedure which updates the

This preview shows page 5 - 6 out of 6 pages.

8. Create, save, and execute a procedure which updates the salary of employees in employees_dup according to the following rules: -if the employee is in department 80, the new salary = 1000 -if the employee is in department 50, the new salary = 2000 -if the employee is in any other department, the new salary = 3000. You will need to include three UPDATE statements, one for each of the above rules. In a later lesson you will learn how to avoid this. Execute your procedure from an anonymous block and verify that the updates have been performed correctly. CREATE OR REPLACE PROCEDURE pay_change IS BEGIN UPDATE employees_dup SET salary = 3000; UPDATE employees_dup SET salary = 2000 WHERE department_id = 50; UPDATE employees_dup SET salary = 1000 WHERE department_id = 80; END pay_change; EMPLOYEE_ ID FIRST_NA ME LAST_NA ME EMAIL PHONE_NUMBE R HIRE_DAT E JOB_ID 100 Steven King SKING 515.123.4567 17-Jun- 2002 AD_PRES 101 Neena Kochhar NKOCHHA R 515.123.4568 21-Sep- 2004 AD_VP 102 Lex De Haan LDEHAAN 515.123.4569 13-Jan- 2008 AD_VP 200 Jennifer Whalen JWHALEN 515.123.4444 17-Sep- 2002 AD_ASST 205 Shelley Higgins SHIGGINS 515.123.8080 07-Jun- 2009 AC_MGR 206 William Gietz WGIETZ 515.123.8181 07-Jun- AC_ACCOU Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Image of page 5
6 2009 T 149 Susan Zlotkey EZLOTKEY 011.44.1344.429 018 29-Jan- 2015 SA_MAN 174 Susan Abel EABEL 011.44.1644.429 267 11-May- 2011 SA_REP 176 Susan Taylor JTAYLOR 011.44.1644.429 265 24-Mar- 2013 SA_REP 178 Kimberely Grant KGRANT 011.44.1644.429 263 24-May- 2014 SA_REP Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Image of page 6

You've reached the end of your free preview.

Want to read all 6 pages?

  • Spring '19
  • ivan
  • All rights reserved

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture