exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 166 discussion

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

You use a Microsoft SQL Server database that contains a table. The table has records of customer orders.
Your company has three divisions that have the following names:
✑ East
✑ Central
✑ West
You need to create a query that displays the following information:
✑ The number of sales for each product (ProductName) grouped by the division (Division) that sold the product
✑ A column for each division
Which Transact-SQL query should you use?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: D
You can use the PIVOT and UNPIVOT relational operators to change a table-valued expression into another table. PIVOT rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output, and performs aggregations where they are required on any remaining column values that are wanted in the final output. UNPIVOT performs the opposite operation to PIVOT by rotating columns of a table-valued expression into column values.
References:
https://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

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
Sim123
4 years, 7 months ago
C must be the correct answer
upvoted 1 times
...
zhannamil
4 years, 7 months ago
I think that the correct answer is C
upvoted 1 times
...
lilupv
4 years, 9 months ago
Why not PIVOT? Divisions must be columns
upvoted 2 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 ...