Question
Consider a brokerage firm database with relations Holdings(AccountId, StockSymbol, CurrentPrice, Quantity) and Balance(AccountId, Balance). Write the triggers for maintaining the correctness of the account balance
Consider a brokerage firm database with relations Holdings(AccountId, StockSymbol, CurrentPrice, Quantity) and Balance(AccountId, Balance). Write the triggers for maintaining the correctness of the account balance when stock is bought (a tuple is added to Holdings or Quantity is incremented), sold (a tuple is deleted from Holdings or Quantity is decremented), or a price change occurs.
A:Solve the problem using both row-level and statement-level triggers.
B:Give an example of a situation when row-level triggers are more appropriate for the above problem
C:and when statement-level triggers are more appropriate.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started