Question: 6 : 4 5 4 G 3 7 Assignment 3 _ 7 6 d 8 7 b 8 c 4 6 ac 3 7 3

6:45
4G
37
Assignment 3_76d87b8c46ac3734...
Done
Using NorthWind database uploaded on moodle solve the following questions:
Write a T-SQL script that calculates the cumulative total of order values from the "OrdersDetails" table. Stop when the cumulative total exceeds $10,000 or you have processed 20 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 (unitPrice*quntity) of each product in the order.
Output sample:
The total price of order number 10248 for customer Paul Henriot is =440
The cumulative total: 440
The total price of order number 10249 for customer Karin Josephs is =1863.4
The cumulative total: 2303.4
2. Write a T-SQL 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: 1, Name: Nancy Davolio, Orders Processed: 123
EmployeeID: 2, Name: Andrew Fuller, Orders Processed: 96
EmployeeID: 3, Name: Janet Leverling, Orders Processed: 127
EmployeeID: 4, Name: Margaret Peacock, Orders Processed: 156
EmployeeID: 5, Name: Steven Buchanan, Orders Processed: 42
Best EmployeeID: 4, Best Name: Margaret Peacock, Orders Processed: 156
3. Write a T-SQL script that calculates the number of pieces of product in each order and if the number of pieces >100 print the orderID and the number of pieces.
Output sample:
OrderID: 10252, Quantity: 105
OrderID: 10253, Quantity: 102
OrderID: 10255, Quantity: 110
OrderID: 10258, Quantity: 121
6 : 4 5 4 G 3 7 Assignment 3 _ 7 6 d 8 7 b 8 c 4

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 Programming Questions!