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 CISDAFinalExerciseMEID.sql Save the output of this script as CISDAFinalExerciseMEID.csv
Use an aggregate window function to display the order id from the OrderItems table along with the total amount for each order item in the OrderItems 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 orderid column
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
