You will be starting the final part of the project very soon, but I want to keep the labs going, but at a reduced scale, so that you can get help for some questions similar to those in the project.
Please submit the questions for this week in a plain text file called submission.sql
with no extraneous text. I will read it in to MySQL just by using the command source submission.sql
and it should then install the triggers.
BankAccount(id INT, balance REAL)
that is so important that you need to keep a duplicate in the table BankAccountCopy
. Write a trigger that will cause any INSERT
statement on BankAccount
to be mirrored in BankAccountCopy
. (Do not worry about DELETE
or UPDATE
).UPDATE
events onBankAccount
are also mirrored (a single trigger can only respond to a single event).BankAccount(id INT, name VARCHAR(64), balance REAL, minimumBalance REAL)
always keeps track of its overall minimum balance throughout a sequence of UPDATE
operations. You may assume that the table is initialized in such that way that every row has minimum balance equal to balance (representing the opening of the account), so you only need to deal with subsequent updates.Written with StackEdit.