You need to create a query that calculates the total sales of each OrderlD from a table
named Sales.Details. The table contains two columns named OrderlD and ExtendedAmount.
The solution must meet the following requirements:
• Use one-part names to reference columns.
• Start the order of the results from OrderlD.
• NOT depend on the default schema of a user.
• Use an alias of TotalSales for the calculated ExtendedAmount.
• Display only the OrderlD column and the calculated TotalSales column.
Provide the correct code in the answer area.

Answer: See the explanation.
Explanation:
SELECT
OrderID,
SUM(ExtendedAmount) AS TotalSales
FROM Sales.Details
GROUP BY OrderID
ORDER BY OrderID
why do you have to put group by?
0
0
Because: “that calculates the total sales of each OrderlD”
for example: You have the following table:
OrderlD ExtendedAmount
1 3.00
2 5.00
1 2.50
The output table have to be:
OrderID TotalSales
1 5.50
2 5.00
Therefore you have to group by OrderID.
0
0
But why order by? nowhere asking for sorting…
0
0
To JF
• Start the order of the results from OrderlD.
0
0
This only means the OrderID is the first column. It doesn’t require the order of result set.
0
0
By the way, part of that new 200Q 70-461 dumps FYI:
https://drive.google.com/open?id=0B-ob6L_QjGLpfnJldlZxTklTaHM0akpJUzhja2pETHJOS0owMzd4eVk1UTVNQUpvdlVxVWM
Best Regards!
0
0
SELECT OrderId,
SUM(ExtendedAmount) AS TotalSales
FROM Sales.Details
GROUP BY OrderID
ORDER BY OrderID;
0
0