Question: Write trigger - varpaychk - which checks for the following compensation rules when a record is INSERTed or UPDATEed into the EMPLOYEE table - BONUS

Write trigger - varpaychk - which checks for the following compensation rules when a record is INSERTed or UPDATEed into the EMPLOYEE table

- BONUS should be < 20% of SALARY

- COMMISSION should be < 25% of SALARY

- Sum of BONUS & COMMISSION should be < 40% of SALARY

Create EMPAUDIT table which records any failure to adhere to the above rules.

The INSERT or UPDATE should still be successful into the EMPLOYEE table, but, an error record should be recorded in the EMPAUDIT table.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sql Create EMPLOYEE table CREATE TABLE EMPLOYEE EMPID INT PRIMARY KEY SALARY DECIMAL10 2 BONUS DECIM... 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!