August S.

asked • 03/02/15

SQL database

 Create a trigger named Products_UPDATE that checks the new value for the DiscountPercent column of the Products table. This trigger should raise an appropriate error if the discount percent is greater than 100 or less than 0. If the new discount percent is between 0 and 1, this trigger should modify the new discount percent by multiplying it by 100. That way, a discount percent of .2 becomes 20. Test this trigger with the following UPDATE Products SET DiscountPercent = .25 WHERE ProductID = 1; Check to make sure the DiscountPercent is 25 with a SELECT statement.

1 Expert Answer

By:

Ron E. answered • 04/29/20

Tutor
4.9 (290)

PL/SQL / SQL / Database Design Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.