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
Sql Create EMPLOYEE table CREATE TABLE EMPLOYEE EMPID INT PRIMARY KEY SALARY DECIMAL10 2 BONUS DECIM... View full answer
Get step-by-step solutions from verified subject matter experts
