Question: Open the trigger named invoices_before_update that was shown in figure 16-2. Then, modify it so it also raises an error whenever the payment total

Open the trigger named invoices_before_update that was shown in figure 16-2. Then, modify it so it also

Open the trigger named invoices_before_update that was shown in figure 16-2. Then, modify it so it also raises an error whenever the payment total plus the credit total becomes larger than the invoice total in a row. Then, test this trigger with an appropriate UPDATE statement. Create a trigger named invoices_after_update. This trigger should insert the old data about the invoice into the Invoices_Audit table after the row is updated. Then, test this trigger with an appropriate UPDATE statement. If the Invoices_Audit table doesn't exist, you can use the code shown in figure 16-3 to create it. Check whether the event scheduler is turned on. If it isn't, code a statement that turns it on. Then, create an event that inserts a test row that contains test values into the Invoices_Audit table every minute. To make sure that this event has been created, code a SHOW EVENTS statement that views this event and a SELECT statement that views the data that's inserted into the Invoices Audit table. Once you're sure this event is working correctly, code a DROP EVENT statement that drops the event.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It seems like youve provided a set of instructions related to MySQL triggers and events Lets break down each step Step 1 Modify the invoicesbeforeupda... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!