Microsoft Exam Questions

You use a Microsoft SQL Server database that contains a table. The table has records of customer ord

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:

You need to create a query that displays the following information:

Which Transact-SQL query should you use?

A.


B.


C.


D.


A. Option A

B. Option B

C. Option C

D. Option 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