70-346 Dumps

Saturday, 26 March 2016

Latets & Updated Microsoft 70-461 Exam

70-461 Question 7

You need to ensure that your query executes in the minimum possible time.
Which query should you use?

A. 
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION ALL
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p
B.  SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p
C.  SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM
DomesticSalesOrders
UNION
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM
InternationalSalesOrders
D.  SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM
DomesticSalesOrders
UNION ALL
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount FROM
InternationalSalesOrders

Correct Answer: A
Explanation/Reference:
Reference: http://msdn.microsoft.com/en-us/library/ms180026.aspx Reference: http://blog.sqlauthority.com/2009/03/11/sql-server-difference-between-union-vs- union-all-optimalperformance-
comparison

No comments:

Post a Comment

Note: only a member of this blog may post a comment.