CORRECT TEXT

CORRECT TEXT
You need to create a query that calculates the total sales of each OrderID from a table named Sales.Details. The table contains two columns named OrderID and ExtendedAmount.
The solution must meet the following requirements:
Use one-part names to reference columns.
Order the results by OrderID with the smallest value first.
NOT depend on the default schema of a user.
Use an alias of TotalSales for the calculated ExtendedAmount.
Display only the OrderID column and the calculated TotalSales column.
Provide the correct code in the answer area.
Key Words:

A. Please review the part for this answer

microsoft-exams

One thought on “CORRECT TEXT

  1. SELECT OrderId, SUM(ExtendedAmount) AS TotalSales
    FROM Sales.Details
    group by OrderId
    ORDER BY OrderID ASC

    Aggregates require a group by statement, always

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.