code must be in SQL SSMS format
/*29. Write a trigger to update the CUST_BALANCE ON CUSTOMER TABLE when an invoice is deleted (INV_NUM) FROM INVOICE TABLE. Name
the trigger trg_updatecustbalance2.*/
30. Write a procedure to delete an invoice (INV_NUM) FROM INVOICE TABLE giving the invoice number as a parameter.
Name the procedure prc_inv_delete. Test the procedure by deleting invoices 8005
and 8006.
TABLE STRUCTURE & CURRENT INV TABLE ARE ATTACHED
Extracted text: 画Results Messages INV_NUM CUST_NUM INV_DATE INV_AMOUNT 1 8000 1000 2016-03-23 235.89 2 8001 1001 2016-03-23 312.82 3 8002 1001 2016-03-30 528.10 4 8003 1000 2016-04-12 194.78 8004 1000 2016-04-23 619.44 8005 1001 2017-04-27 225.40 8006 1000 2018-04-30 302.00 67
Extracted text: dbo.CUSTOMER Columns mo CUST_NUM (PK, int, not null) E CUST_LNAME (varchar(30), null) E CUST_FNAME (varchar(30), null) E CUST_BALANCE (decimal(9,2), nu E CUST_ DOB (date, null) Keys Constraints Triggers Indexes Statistics dbo.EMP_1 dbo.EMP_2 dbo.EMPLOYEE dbo.INVOICE Columns ro INV_NUM (PK, int, not null) C- CUST_NUM (FK, int, null) E INV_DATE (date, null) E INV_AMOUNT (decimal(11,2), nul Keys Constraints Triggers Indexes + Statistics dbo.JOB dbo.PROJECT Views External Resources 囲回 田田