Question: 1. Create a trigger that updates Orders.totalAmount whenever there is any change to the OrderedProduct table. 2. Create a trigger that deletes all Orders and
1. Create a trigger that updates Orders.totalAmount whenever there is any change to the OrderedProduct table.
2. Create a trigger that deletes all Orders and OrderedProduct records for a customer if that customer is deleted from the database. (This would be an alternative to using CASCADING foreign key references).
Product (productId, productName, categoryName, packageDesc, price) Customer (customerId, password, cname, street, city, state, zipcode, phone, email) Orders (orderId, customerId, totalAmount) OrderedProduct (orderId, productId, quantity, price)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
