Question: We are preparing to archive old data from the Sales Orders Modify database. Before we do this, we would like to update the OrderTotal column

We are preparing to archive old data from the Sales Orders Modify database. Before we do this, we would like to update the OrderTotal column for each order to be sure that it reflects the total of the line items in that order. First, write a SELECT query showing what the OrderTotal should be for each order. Include three columns: the order number, the current order total and the calculated order total (as NewOrderTotal). Use a subquery as the third column to calculate the total of the line items for that order.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets assume table name as SalesOrders columns like OrderNumber ... 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!