AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Microsoft- 70-461





Question ID 15098

You generate a daily report according to the following query:

You need to improve the performance of the query.
What should you do?

Option 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 ) SELECT c.CustomerName FROM cte INNER JOIN Sales.Customer c ON cte.CustomerID = c.CustomerID WHERE cte.LastOrderDate < DATEADD(DAY, -90, GETDATE())

Option B

Drop the UDF and rewrite the report query as follows: SELECT c.CustomerName FROM Sales.Customer c WHERE NOT EXISTS ( SELECT s.OrderDate FROM Sales.SalesOrder s WHERE s.OrderDate > DATEADD(DAY, -90, GETDATE()) AND s.CustomerID = c.CustomerID)

Option C

Drop the UDF and rewrite the report query as follows: SELECT DISTINCT c.CustomerName FROM Sales.Customer c INNER JOIN Sales.SalesOrder s ON c.CustomerID = s.CustomerID WHERE s.OrderDate < DATEADD(DAY, -90, GETDATE())

Option D

Rewrite the report query as follows: SELECT c.CustomerName FROM Sales.Customer c WHERE NOT EXISTS (SELECT OrderDate FROM Sales.ufnGetRecentOrders(c.CustomerID, 90)) Rewrite the UDF as follows: CREATE FUNCTION Sales.ufnGetRecentOrders(@CustomerID int, @MaxAge datetime) RETURNS TABLE AS RETURN ( SELECT OrderDate FROM Sales.SalesOrder s WHERE s.CustomerID = @CustomerID AND s.OrderDate > DATEADD(DAY, -@MaxAge, GETDATE())

Correct Answer A
Explanation


Question ID 15099

You develop a Microsoft SQL Server 2012 server database that supports an application.
The application contains a table that has the following definition:
CREATE TABLE Inventory (
ItemID int NOT NULL PRIMARY KEY,
ItemsInStore int NOT NULL,
ItemsInWarehouse int NOT NULL)
You need to create a computed column that returns the sum total of the ItemsInStore and
ItemsInWarehouse values for each row.
The new column is expected to be queried heavily, and you need to be able to index the
column. Which Transact-SQL statement should you use?

Option A

ALTER TABLE Inventory ADD TotalItems AS ItemslnStore + ItemsInWarehouse

Option B

ALTER TABLE Inventory ADD TotalItems AS ItemsInStore + ItemsInWarehouse PERSISTED

Option C

ALTER TABLE Inventory ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse) PERSISTED

Option D

ALTER TABLE Inventory ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse)

Correct Answer B
Explanation Reference: http://msdn.microsoft.com/en-us/library/ms174979.aspx

Send email to admin@getfreedumps for new dumps request!!!