Which Transact-SQL query should you use?
You support a database structure shown in the exhibit. (Click the Exhibit button.) You need to write a query that displays the following details: • Total sales made by sales people, year, city, and country • Sub totals only at the city level and country level • A grand total...
What should you do?
You administer a Microsoft SQL Server 2012 database. The database contains a Product table created by using the following definition: You need to ensure that the minimum amount of disk space is used to store the data in the Product table. What should you do?A . Convert all indexes to...
Which code segment should you use?
You use Microsoft SQL Server 2012 to develop a database application. Your application sends data to an NVARCHAR (MAX) variable named @var. You need to write a Transact-SQL statement that will find out the success of a cast to a decimal (36, 9). Which code segment should you use?A ....
Which table hint should you use?
You develop a Microsoft SQL Server 2012 database that contains a heap named OrdersHistorical. You write the following Transact-SQL query: • INSERT INTO OrdersHistorical • SELECT * FROM CompletedOrders You need to optimize transaction logging and locking for the statement. Which table hint should you use?A . HOLDLOCKB . ROWLOCKC...
Which Transact-SQL query or queries should you use?
You administer a Microsoft SQL Server database that supports a banking transaction management application. You need to retrieve a list of account holders who live in cities that do not have a branch location. Which Transact-SQL query or queries should you use? (Each correct answer presents a complete solution. Choose...
Which code segment should you use?
CORRECT TEXT You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements: • UnitPrice must be returned in descending order. • The...
Which code segment should you use?
CORRECT TEXT You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements: • UnitPrice must be returned in descending order. • The...
What should you do?
You generate a daily report according to the following query: You need to improve the performance of the query. What should you do?A . Drop the UDF and rewrite the report query as follows: WITH cte(CustomerID, LastOrderDate) AS ( SELECT CustomerID, MAX(OrderDate) AS [LastOrderDate] FROM Sales.SalesOrder GROUP BY CustomerID )...
Which Transact-SQL statement should you use?
You use Microsoft SQL Server 2012 to develop a database application. You create a stored procedure named DeleteJobCandidate. You need to ensure that if DeleteJobCandidate encounters an error, the execution of the stored procedure reports the error number. Which Transact-SQL statement should you use?A . DECLARE @ErrorVar INT; DECLARE @RowCountVar...
Which Transact-SQL operator should you use?
You use Microsoft SQL Server 2012 database to develop a shopping cart application. You need to rotate the unique values of the ProductName field of a table-valued expression into multiple columns in the output. Which Transact-SQL operator should you use?A . CROSS JOINB . CROSS APPLYC . PIVOTD . UNPIVOTView...