Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please some help: Notice: before working on these problems, please execute the command set serveroutput on; Execute the script files companyDB.sql each time before you

Please some help:

Notice: before working on these problems, please

execute the command

set serveroutput on;

Execute the script files companyDB.sql each time before you start to work on a problem (not a sub-problem).

1. Update trigger

a. Write a trigger that fires when an employees salary is updated. The trigger will write a record into a table called SalUpdates. The record should contain the information of SSN, new salary, old salary, and date when the change is made. (Hint: You need create the table SalUpdates first)

b. Test the above trigger by updating the salary of employee with ssn=123456789 to 40000. List the tables employee and SalUpdates to verify the results are correct.

2. Delete Trigger: Write a trigger that fires when a command tries to delete some rows from DEPARTMENT table. The trigger will reject the deletion and display the warning information failed operation to the user. (Tip: use the system function raise_application_error).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago