Question: Create a row-level trigger called trg mgr change that will fire when the manager of some department is changed. When this happens, the trigger


Create a row-level trigger called trg mgr change that will fire when 

Create a row-level trigger called trg mgr change that will fire when the manager of some department is changed. When this happens, the trigger increases the salary of the new manager by 10% and decreases the salary of the old manager by 5%. Test the trigger as follows: (5 points) SQL> SELECT Salary FROM EMPLOYEE WHERE Ssn-'123456789'; SALARY 30000 SQL> SELECT Salary FROM EMPLOYEE WHERE Ssn='333445555'; SALARY 40000 SQL> UPDATE DEPARTMENT SET Mgr_ssn-123456789' WHERE Dnumber=5; SQL> SELECT Salary FROM EMPLOYEE WHERE sn='333445555'; SALARY 38000 SQL> SELECT Salary FROM EMPLOYEE WHERE Ssn='123456789; SALARY 33000 As shown above, the manager of the Research department was changed from Franklin Wong to John Smith, as an expected outcome of the trigger, the salary of Franklin Wong went down by 5% to become 38000 and the salary of the new manage John Smith went up by 10% to become 33000.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!