The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Please look at the following attached document that has question # 6 and 8 from Chapter 15 MyGuitarShop SQL exercise.Â
Â
My Guitar Shop exercises.docxMurach’s SQL Server 20126. Create a trigger named Products_UPDATE that checks the new value for the DiscountPercent columnof the Products table. This trigger should raise an appropriate error if the discount percent is greaterthan 100 or less than 0.If the new discount percent is between 0 and 1, this trigger should modify the new discount percent bymul±plying it by 100. That way, a discount percent of .2 becomes 20.Test this trigger with an appropriate UPDATE statement.8. Create a table named ProductsAudit. This table should have all columns of the Products table, exceptthe Descrip±on column. Also, it should have an AuditID column for its primary key, and the DateAddedcolumn should be changed to DateUpdated.Create a trigger named Products_UPDATE. This trigger should insert the old data about the product intothe ProductsAudit table aFer the row is updated.Then, test this trigger with an appropriate UPDATE statement.This lists the original columns on the Products table.
Attachments:
-----------