Question: The product _ id column from the Order _ Items table The product _ name from the Products table The total amount for each order
The productid column from the OrderItems table
The productname from the Products table
The total amount for each order item record in the OrderItems table Hint: You can calculate the
total amount by subtracting the discount amount from the item price and then multiplying it by
the quantity Alias this field as orderlinetotal.
Use an aggregate window function to get a summation of order items records in the Orderltems
table, partioned by productid Alias this field as totalbyproduct
Sort the result set in ascending sequence by the productid column.
Below is a screenshot of records returned by this query. The aggregate window function
highlighted.
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
