Question: 6 : 4 5 4 G 3 7 Assignment 3 _ 7 6 d 8 7 b 8 c 4 6 ac 3 7 3
:
G
Assignment dbcac
Done
Using NorthWind database uploaded on moodle solve the following questions:
Write a TSQL script that calculates the cumulative total of order values from the "OrdersDetails" table. Stop when the cumulative total exceeds $ or you have processed orders.
The output should be the orderID, customer's name along with the total price of the order and the changing cumulative price.
Note: The total price of order is adding all unitPricequntity of each product in the order.
Output sample:
The total price of order number for customer Paul Henriot is
The cumulative total:
The total price of order number for customer Karin Josephs is
The cumulative total:
Write a TSQL script that creates a cursor to retrieve each employee's ID name, and the total number of orders they have processed, and tell me the data of best employee.
Output sample:
EmployeeID: Name: Nancy Davolio, Orders Processed:
EmployeeID: Name: Andrew Fuller, Orders Processed:
EmployeeID: Name: Janet Leverling, Orders Processed:
EmployeeID: Name: Margaret Peacock, Orders Processed:
EmployeeID: Name: Steven Buchanan, Orders Processed:
Best EmployeeID: Best Name: Margaret Peacock, Orders Processed:
Write a TSQL script that calculates the number of pieces of product in each order and if the number of pieces print the orderID and the number of pieces.
Output sample:
OrderID: Quantity:
OrderID: Quantity:
OrderID: Quantity:
OrderID: Quantity:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
