Question: Write a SELECT statement that uses an aggregate window function to get the total of records in the Order _ Items table. Return these columns:
Write a SELECT statement that uses an aggregate window function to get the total of records in
the OrderItems table. Return these columns:
The productid column from the Orderltems 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 all order items records in the
OrderItems table. Alias this field as totalallorderlines
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
