subject

Write a SELECT statement that uses the OVER clause to return the sum and average of all order items final prices (ItemPrice minus DiscountAmount) and a count of all the order items. Partition the OVER clause by OrderDate from the Orders table for the sum, average, and count. Also include the product name, orderdate, and the final price for each item (without aggregation) using the formula (ItemPrice minus DiscountAmount). The select statement should include the following columns in the order below: The ProductName column from the Products table.
The OrderDate column from the Orders table.
A calculated column with alias "ItemSalesPrice" which is calculated as follows: ItemPrice minus the DiscountAmount from the OrderItems table.
OVER clause: sum of the ItemPrice minus the DiscountAmount from the OrderItems table partitioned by the OrderDate from the Orders table. Use alias "TotalSalesOnDate" for the calculated column.
OVER clause: average of the ItemPrice minus the DiscountAmount from the OrderItems table partitioned by the OrderDate from the Orders table. Use alias "AvgSalesOnDate" for the calculated column.
OVER clause: count of the ItemPrice from the OrderItems table partitioned by the OrderDate from the Orders table. Use alias "TotalItemsSoldOnDate" for the calculated column.
Sort the result set in ascending sequence by OrderDate and ProductName.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Ideally, the backrest is tilted back slightly, so when you turn the wheel your shoulders are the seat.
Answers: 2
You know the right answer?
Write a SELECT statement that uses the OVER clause to return the sum and average of all order items...
Questions
question
Mathematics, 16.10.2020 05:01
question
Chemistry, 16.10.2020 05:01
question
Mathematics, 16.10.2020 05:01
question
Mathematics, 16.10.2020 05:01