Which Transact-SQL query should you use?

Posted by: Pdfprep Category: 70-461 Tags: , ,

You use a Microsoft SQL Server database that contains a table.

The table has records of web requests as shown in the exhibit. (Click the Exhibit button.)

Your network has three web servers that have the following IP addresses:

– 10.0.0.1

– 10.0.0.2

– 10.0.0.3

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

– The number of requests for each web page (UriStem) grouped by the web server (ServerIP) that served the request

– A column for each server

Which Transact-SQL query should you use?

A . Option A
B . Option B
C . Option C
D . Option D

Answer: A

Explanation:

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.

References: https://docs.microsoft.com/en-us/sql/t-sql/queries/from-using-pivot-and­unpivot?view=sql-server-2017

Leave a Reply

Your email address will not be published.