Starting from:
$35

$29

Assignment 4 Part 2 Solution


Create two triggers that work with the SQL tables from the lab 1. (30 points [15 points each])

    1. Create `update_balance_trigger` on the ​transaction​table. The trigger will be used (triggered) to update the current balance of the credit card by adding the dollar amount of a transaction every time a tuple is inserted into the transaction table.

    2. Create `check_balance_trigger` on the ​credit card​table. If a ​credit card​tuple is updated, then the trigger should make sure that the new credit card balance is less than the new credit limit. If it is not, then you should signal the exception 12345.

Make sure your triggers work on the MySQL database. Submit only the code for the two triggers.



Submission

Please submit your work as a sql file to polylearn.

More products