Question: 1 ) Consider the following trigger that will execute when the manager of the department is updated. Add the necessary code to raise salary of

1) Consider the following trigger that will execute when the manager of the department is updated. Add the necessary code to raise salary of the new manager by 5%: (4 points)
CREATE OR REPLACE TRIGGER trg_dept
BEFORE UPDATE OF Mgr_ssn ON DEPARTMENT
FOR EACH ROW
BEGIN
END;
You may test it like this by making:
UPDATE DEPARTMENT SET Mgr_ssn=666884444 WHERE Dnumber=5;
Now check the salary of the employee whose SSN=666884444 and verify that it is 39900.
2) Complete the following stored procedure list_dependents on page 2. This procedure has one input parameter called emp_ssn and when called, will produce a report showing the dependents (if any) of this employee. Here is an example to illustrate this procedure: (6 points)
SQL> exec list_dependents(123456789);
Dependent_name Relationship
=====================================
Michael Son
Alice Daughter
Elizabeth Spouse
create or replace procedure list_dependents(emp_ssn IN char) IS
cursor dependents_cursor is
begin
dbms_output.put_line('Dependent Name Relationship');
dbms_output.put_line('==================================');
open dependents_cursor;
loop
end loop;
close dependents_cursor;
end;

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 Programming Questions!