Write trigger which is called trigcom which is activated when an INSERT or UPDATE takes place against
Question:
Write trigger which is called trigcom which is activated when an INSERT or UPDATE takes place against the SALARY table. The trigger will check two compensation items:
(a) Ensure that the COMMISSION amount is no more than 25% of the SALARY
(b) Ensure that the sum of COMMISSION and SALARY is at least 50,000.
If either (a) or (b) is true, you will report an appropriate message by recording a record in a SALAUD table.
There should be a different code depending on which rule was broken
No record should be INSERTed into the SALAUD table if both rules (a) and (b) are adhered to.
The SALAUD table should have the following columns:
- Employee ID (ID)
- Date (Today's date)
- Salary
- Commission
- Error Code
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last