READ Free Dumps For Microsoft- 70-461
Question ID 15068 | You develop a Microsoft SQL Server 2012 database. You need to create a batch process
that meets the following requirements:
✑ Status information must be logged to a status table.
✑ If the status table does not exist at the beginning of the batch, it must be created.
Which object should you use?
|
Option A | Scalar user-defined function
|
Option B | Inline user-defined function
|
Option C | Table-valued user-defined function
|
Option D | Stored procedure
|
Correct Answer | D |
Explanation Reference: http://msdn.microsoft.com/en-us/library/ms186755.aspx
Question ID 15069 | Your database contains a table named Purchases. The table includes a DATETIME
column named PurchaseTime that stores the date and time each purchase is made. There
is a non-clustered index on the PurchaseTime column.
The business team wants a report that displays the total number of purchases made on the
current day.
You need to write a query that will return the correct results in the most efficient manner.
Which Transact-SQL query should you use?
|
Option A | SELECT COUNT(*) FROM Purchases WHERE PurchaseTime = CONVERT(DATE, GETDATE())
|
Option B | SELECT COUNT(*) FROM Purchases WHERE PurchaseTime = GETDATE()
|
Option C | SELECT COUNT(*) FROM Purchases WHERE CONVERT(VARCHAR, PurchaseTime, 112) = CONVERT(VARCHAR, GETDATE(), 112)
|
Option D | SELECT COUNT(*) FROM Purchases WHERE PurchaseTime >= CONVERT(DATE, GETDATE()) AND PurchaseTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))
|
Correct Answer | D |
Explanation Explanation: Two answers will return the correct results (the "WHERE CONVERT..." and "WHERE ... AND ... " answers). The correct answer for Microsoft would be the answer that is most "efficient". Anybody have a clue as to which is most efficient? In the execution plan, the one that I've selected as the correct answer is the query with the shortest duration. Also, the query answer with "WHERE CONVERT..." threw warnings in the execution plan...something about affecting CardinalityEstimate and SeekPlan. I also found this article, which leads me to believe that I have the correct answer: http://technet.microsoft.com/en-us/library/ms181034.aspx