Triggers In the database ProductOrders created in the previous exercise, create the following triggers: 1. Trigger...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Triggers In the database "ProductOrders" created in the previous exercise, create the following triggers: 1. Trigger to print a message "N customers are successfully inserted" when some customers are inserted into the Customers table, where N is the number of inserted customers. 2. Trigger for the insertion of a product into an order (insert into Orderltems), if SellPrice < Price then do not allow the insertion (use after or for in this trigger). 3. Trigger for the update of SellPrice in OrderItems, if SellPrice < Price, then do not allow the update (use instead of in this trigger). 4. Trigger for the insertion of a product into an order (insert into OrderItems): a. If Quantity > StockQuantity, then refuse the insertion. b. If Quantity <= StockQuantity, then update the StockQuantity of the corresponding product (StockQuantity = StockQuantity - Quantity) 5. Trigger for the update of Quantity in OrderItems: a. If the StockQuantity is not enough after the update, then refuse the update b. If the StockQuantity is enough after the update, then update the StockQuantity of the corresponding Product. 6. Trigger for the insertion of a product into an order (insertion into OrderItems): a. Update the Discount of the corresponding row in Orderltems table. b. Update the Amount of the corresponding order in Orders table. 7. Trigger for the update of OrderItems: a. Update the quantity of product in Products table. b. Update the Amount of the corresponding order in Orders table. Triggers In the database "ProductOrders" created in the previous exercise, create the following triggers: 1. Trigger to print a message "N customers are successfully inserted" when some customers are inserted into the Customers table, where N is the number of inserted customers. 2. Trigger for the insertion of a product into an order (insert into Orderltems), if SellPrice < Price then do not allow the insertion (use after or for in this trigger). 3. Trigger for the update of SellPrice in OrderItems, if SellPrice < Price, then do not allow the update (use instead of in this trigger). 4. Trigger for the insertion of a product into an order (insert into OrderItems): a. If Quantity > StockQuantity, then refuse the insertion. b. If Quantity <= StockQuantity, then update the StockQuantity of the corresponding product (StockQuantity = StockQuantity - Quantity) 5. Trigger for the update of Quantity in OrderItems: a. If the StockQuantity is not enough after the update, then refuse the update b. If the StockQuantity is enough after the update, then update the StockQuantity of the corresponding Product. 6. Trigger for the insertion of a product into an order (insertion into OrderItems): a. Update the Discount of the corresponding row in Orderltems table. b. Update the Amount of the corresponding order in Orders table. 7. Trigger for the update of OrderItems: a. Update the quantity of product in Products table. b. Update the Amount of the corresponding order in Orders table.
Expert Answer:
Answer rating: 100% (QA)
SOLUTION1 Givendat We are create a trigger on ride table when return time is changed to an earlier time Please insert a message into parkmessage table for each customer who has unused reservation stat... View the full answer
Posted Date:
Students also viewed these databases questions
-
Jamison and Co make lightweight yoga mats. Jamison is preparing its budget for the second quarter of 2022. Each mat sells for $24. Sales in units are as follows: February 12,000 $288,000 March 12,000...
-
Refer to Exercise 4.11, where Y is the number of firing pins tested in a sample of five selected from a large lot. Suppose the cost of inspecting a single pin is $300 if the pin is defective and $100...
-
Prunella raises peaches. Where L is the number of units of labor she uses and T is the number of units of land she uses, her output is f (L, T) = L 1 2 T 1 2 bushels of peaches. (a) On the graph...
-
How are externalities reduced within a firm?
-
A new highway has just been completed and the government must decide on speed limits. There are several possible choices. However, on advice from police who monitor traffic the objective was to...
-
Find the number of rotational levels per unit energy interval, dN/dE, for a diatomic molecule as a function of rotational energy E. Calculate that magnitude for an iodine molecule in the state with...
-
How would you defi ne the difference between a responsible board and an exceptional board?
-
On January 1, 2011, Sherwood Company, an 80% owned subsidiary of Paradise Company, sold to Paradise Company equipment with a book value of $600,000 for $840,000. The equipment had an estimated...
-
You are considering investing in Woolworths (ASX: WOW). You will need to make an investment recommendation based on the market and your theoretical value of Woolworths. This question is designed such...
-
Selected transactions completed by Kornett Company during its first fiscal year ended December 31, 20Y8, were as follows: Jan. 3. Issued a check to establish a petty cash fund of $4,500. Feb. 26....
-
Manvi Motors of Malaysia produces cars under an agreement with Suzuki of Japan and trucks under an agreement with General Motors of the USA. The company was established in 1972 and now employs...
-
Show an understanding of the materials for supply demand, and economic equilibrium for part 1 and 2 of my paper. Part 1 is Economic events and activity analysis and part 2 is Economic concentration...
-
The model for the IS-LM model is given below. Y = C +1 + G C = C(Y - T, R) I= I(Y, R) T = T(Y) M/P = L(Y, R) A) Find the effect of the increase in government spending on income and interest rate....
-
Two months earlier, Kappa Labs had approached Merck with a proposal that Merck purchase the rights to KL-798 for an upfront payment of $30 million and royalty payments over the first 10 years of the...
-
IF YOU HAVE THESE THREE DESIRABLE CHARACTERISTICS, I love to help people in need. Honesty: I am honest. Self-discipline: I am self-disciplined. Give 3 Examples of how each of these has been...
-
There are a total of 1,050 workers in the economy, and workers can either seek employment in one of two sectors: Sector 1 or Sector 2. The graph below depicts the marginal revenue product curves for...
-
Let QUESTION 9 1 f(x, y) = e (a). Find the domain of f. (b). Determine whether the values 0, 1, and -1 are in the range of f. Justify your answer. (c). Find and sketch the level curves f(x, y) = and...
-
on 8 For the following set of lengths 130, 170, 160, 160, 150, 190 Third quartile is: et red d out of Select one: O a. 160 a question O b. 145 O c. 175 O d. 180
-
On January 1, Lorraine, Inc., entered into a lease contract. The lease contract was a ten-year lease for a computer with \(\$ 15,000\) annual lease payments due at the end of each year. Lorraine took...
-
The relation between a bond's coupon rate and yield rate is known to influence a bond's issuance price. Presented below are coupon rates and yield rates for a selection of corporate bonds. Identity...
-
The following costs were incurred for the month of June for the Process A23 Department. Use this information to prepare a responsibility report for the month of June. Budget Actual Sales in units.....
Study smarter with the SolutionInn App