Question: Given CREATE TABLE C _ WORKER ( WID CHAR ( 3 ) PRIMARY KEY, WName VARCHAR 2 ( 1 2 ) , WSalary NUMBER (
Given CREATE TABLE CWORKER
WID CHAR PRIMARY KEY,
WName VARCHAR
WSalary NUMBER
; CREATE TABLE TAXVALUES
MaxAmount NUMBER
TaxRate NUMBER
; CREATE TABLE TAUDIT
WID CHAR REFERENCES CWORKERWID
OLDSal NUMBER
NEWSal NUMBER
OLDTax NUMBER
NEWTax NUMBER
auditDate DATE DEFAULT SYSDATE,
PRIMARY KEY WID auditDATE
; Write a SQL trigger that will do the following:
The trigger should be named NewTaxByLastFirst. The trigger should be fired after a salary
of a worker changes. It only should run for those workers not withholding the maximum tax before the
update. It should insert all the information requested in the TAUDIT table for each time the trigger
body runs once for each row meeting the condition It should output each workers information on a
single line, showing their ID old salary, old tax amount, new salary, new tax amount, and difference of
tax withheld. The output should look like this:
:
:
:
:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
