Question: Write an SQL script that does the following and save this script as CIS 2 7 6 DA _ FinalExercise 7 _ MEID.sql . Save

Write an SQL script that does the following and save this script as CIS276DA_FinalExercise7_MEID.sql . Save the output of this script as CIS276DA_FinalExercise7_MEID.csv
Use an aggregate window function to display the order id from the Order_Items table along with the total amount for each order item in the Order_Items table. (HINT: Don't forget the discount!)
Also display the total amount for each order
Use an aggregate window function to get the average item amount for each order and display that as a column in the results.
Use a named window for the two aggregate functions.
Sort the results in ascending order by the order_id column

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