Question: Use MICROSOFT SQL SERVER language to fill the block like (...) Here is the diagram 1)Create a trigger that can update the ItemNum field automatically

Use MICROSOFT SQL SERVER language to fill the block like (...)

Here is the diagram

Use MICROSOFT SQL SERVER language to fill the block like (...) Here

1)Create a trigger that can update the ItemNum field automatically

is the diagram 1)Create a trigger that can update the ItemNum field

The trigger should be create on InvoiceItemeven if the modified value will be in the Invoice table. We use the inserted and deleted tabled to update the amount of items. The solution is complicated since at the inserted table, we group by invoice number.

2)Test the trigger. The command, the expected and the real results should be documented.

update InvoiceItem

set ..................... write here you code

Payment Method Order ID 9 ID Date Method Deadline PlaceOfBusiness ID Zip Code City Street Deadline PlaceOfBusinessID StatusID Payment Methodid Customer Y ID Name BankAccount Login Password Email MainPlaceOfBusiness Fax Customer Status 8 ID Name Invoicelssuer 9 ID Orderltem ID Amount Price Order D ProductiD StatusID Category 9 ID Invoice* Y ID CustomerName CustomerZipCode Customer City Customer Street PrintedCopies Cancelled Payment Method CreationDate DeliveryDate Payment Deadline InvoicelssuerlD Order Name ZipCode City Street Taxidentifier BankAccount Name ParentCategory Product VAT Y ID Name Invoiceltem Price Percentage Name Amount InStock VATID CategoryID Description Image Price VATPercentage InvoicelD OrderitemID create trigger Invoice ItemNumTG on Invoiceltem after insert, update, delete as begin update Invoice set itemNum = ItemNum + change from Invoice inner join (.....................) write here you code update Invoice set itemNum = ItemNum - change from Invoice inner join (.....................) write here you code end Payment Method Order ID 9 ID Date Method Deadline PlaceOfBusiness ID Zip Code City Street Deadline PlaceOfBusinessID StatusID Payment Methodid Customer Y ID Name BankAccount Login Password Email MainPlaceOfBusiness Fax Customer Status 8 ID Name Invoicelssuer 9 ID Orderltem ID Amount Price Order D ProductiD StatusID Category 9 ID Invoice* Y ID CustomerName CustomerZipCode Customer City Customer Street PrintedCopies Cancelled Payment Method CreationDate DeliveryDate Payment Deadline InvoicelssuerlD Order Name ZipCode City Street Taxidentifier BankAccount Name ParentCategory Product VAT Y ID Name Invoiceltem Price Percentage Name Amount InStock VATID CategoryID Description Image Price VATPercentage InvoicelD OrderitemID create trigger Invoice ItemNumTG on Invoiceltem after insert, update, delete as begin update Invoice set itemNum = ItemNum + change from Invoice inner join (.....................) write here you code update Invoice set itemNum = ItemNum - change from Invoice inner join (.....................) write here you code end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!