Question: Write trigger - empvac - which adds a record into a VACATION table for each EMPLOYEE who is INSERTed or UPDATEed into the EMPLOYEE table

Write trigger - empvac - which adds a record into a VACATION table for each EMPLOYEE who is INSERTed or UPDATEed into the EMPLOYEE table to ensure the difference between the HIREDATE and CURRENT DATE (SYSDATE) follows these rules:

- If employee was hired < 10 years ago - they get 3 weeks (15 days) vacation

- If employee was hired 10-19 years ago - they get 4 weeks (20 days) vacation

- If employee was hired 20-29 years ago - they get 5 weeks (25 days) vacation

- If employee was hired 30+ years ago - they get 6 weeks (30 days) vacation

If a record from the EMPLOYEE table is deleted - the associated record from the VACATION table should also be deleted.

VACATION Table Schema:

- EMPID

- HIREDATE

- VACATION DAYS

Step by Step Solution

3.34 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

create the trigger empvac as described youll need t... View full answer

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!