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

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

Step by Step Solution

3.41 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is an example of a trigger named trigcom that meets the requirements you specified sql Copy CRE... 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!