Question: Write the code for the following triggers following the style shown in the text. a. When adding a customer, add the customers balance times the

Write the code for the following triggers following the style shown in the text.
a. When adding a customer, add the customer’s balance times the sales rep’s commission rate to the commission for the corresponding sales rep.
b. When updating a customer, add the difference between the new balance and the old balance multiplied by the sales rep’s commission rate to the commission for the corresponding sales rep.
c. When deleting a customer, subtract the balance multiplied by the sales rep’s commission rate from the commission for the corresponding sales rep.

Step by Step Solution

3.38 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a DELIMITER CREATE TRIGGER AddCustomer AFTER INSERT ON C... 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

Document Format (1 attachment)

Word file Icon

671-CS-DB (977).docx

120 KBs Word File

Students Have Also Explored These Related Databases Questions!