exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 131 discussion

Actual exam question from Microsoft's 70-461
Question #: 131
Topic #: 1
[All 70-461 Questions]

SIMULATION -
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:

Show Suggested Answer Hide Answer
Suggested Answer: Please review the explanation part for this answer.
SELECT OrderId, SUM(ExtendedAmount) AS TotalSales

FROM Sales.Details -
ORDER BY OrderID ASC

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
levoshchypok
4 years, 9 months ago
I think in response have to be group by clause.
upvoted 4 times
Jaayu
4 years, 5 months ago
Yes, correct there should be a Group by OrderId
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...