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, 2 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 USE SQL SERVER TO EXECUTE THESE PLEASE. PROVIDE SCREENSHOTS!
Â
20. Now let us do something more complex with a trigger. Imagine that we would like to
store a history of price changes for each item. To do so, we would first need to create an
Item_price_history table that stores at a minimum a reference to the item, its old price,
its new price, and the date of the change. We could then define a trigger on the Item
table that updates the Item_price_history table whenever an item price is updated.
For this step, go ahead and create the Item_price_history table as described. Paste in an
updated ERD which includes that new table. Also capture a screenshot of the table
creation in SQL.
Â
21. Define the trigger as described in the previous step
Â
22. Last, change the price of plates to 11, and the price of spoons to 4. Capture a
screenshot of a listing of the contents of the Item_price_history table, which verifies
that your trigger did indeed store the price change history as expected. Briefly explain
the contents of the table.