Ensurepass

QUESTION 21
You have a database that contains the tables as shown below:
You have a stored procedure named Procedure1. Procedure1 retrieves all order ids after a specific date. The rows for Procedure1 are not sorted. Procedure1 has a single parameter named Parameter1. Parameter1 uses the varchar type and is configured to pass the specific date to Procedure1. A database administrator discovers that OrderDate is not being compared correctly to Parameter1 after the data type of the column is changed to datetime. You need to update the SELECT statement to meet the following requirements:
The code must NOT use aliases.
The code must NOT use object delimiters.
The objects called in Procedure1 must be able to be resolved by all users.
OrderDate must be compared to Parameter1 after the data type of Parameter1 is changed to datetime.
Which SELECT statement should you use?
To answer, type the correct code in the answer area.
A.
Correct Answer:
Explanation/Reference: SELECT Orders.OrderID FROM Orders
WHERE Orders.OrderDate>CONVERT(datetime,@Parameter1)

QUESTION 22
You use Microsoft SQL Server 2012 database to develop a shopping cart application. You need to invoke a table-valued function for each row returned by a query. Which Transact-SQL operator should you use?
A. CROSS JOIN B. UNPIVOT
C. PIVOT
D. CROSS APPLY
Correct Answer: D
Explanation/Reference:
Verified answer as correct.
Reference: http://msdn.microsoft.com/en-us/library/ms175156.aspx

QUESTION 23
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 of the sales amount
Which Transact-SQL query should you use?
A. SELECT SalesPerson.Name, Country, City,
DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total
FROM Sale INNER JOIN SalesPerson
ON Sale.SalesPersonID = SalesPerson.SalesPersonID
GROUP BY GROUPING SETS((SalesPerson.Name, Country, City, DatePart(yyyy,
SaleDate)), (Country, City), (Country), ())
B. SELECT SalesPerson.Name, Country, City,
DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total
FROM Sale INNER JOIN SalesPerson
ON Sale.SalesPersonID = SalesPerson.SalesPersonID
GROUP BY CUBE(SalesPerson.Name, Country, City, DatePart(yyyy, SaleDate))
C. SELECT SalesPerson.Name, Country, City,
DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total
FROM Sale INNER JOIN SalesPerson
ON Sale.SalesPersonID = SalesPerson.SalesPersonID
GROUP BY CUBE(SalesPerson.Name, DatePart(yyyy, SaleDate), City, Country)
D. SELECT SalesPerson.Name, Country, City,
DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total
FROM Sale INNER JOIN SalesPerson
ON Sale.SalesPersonID = SalesPerson.SalesPersonID
GROUP BY ROLLUP(SalesPerson.Name, DatePart(yyyy, SaleDate), City, Country)
Correct Answer: A
Explanation/Reference:
Verified answer as correct.
Reference: http://www.grapefruitmoon.net/diving-into-t-sql-grouping-sets/ Reference: http://msdn.microsoft.com/en-us/library/ms177673.aspx

QUESTION 24
You are developing a database that will contain price information. You need to store the prices that include a fixed precision and a scale of six digits. Which data type should you use?
A. Float
B. Money
C. Smallmoney
D. Numeric
Correct Answer: D
Explanation/Reference:
Numeric is the only one in the list that can give a fixed precision and scale.
Reference: http://msdn.microsoft.com/en-us/library/ms179882.aspx

QUESTION 25
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 all that apply.)
A. SELECT AccountHolderID FROM AccountHolder
WHERE CityID NOT IN (SELECT CityID FROM BranchMaster)
B. SELECT AccountHolderID FROM AccountHolder
WHERE CityID <> ALL (SELECT CityID FROM BranchMaster)
C. SELECT AccountHolderlD FROM AccountHolder
WHERE CityID <> SOME (SELECT CityID FROM BranchMaster)
D. SELECT AccountHolderID FROM AccountHolder
WHERE CityID <> ANY (SELECT CityID FROM BranchMaster)
Correct Answer: AB
Explanation/Reference:
Verified the answers as correct.
Reference: http://msdn.microsoft.com/en-us/library/ms188047.aspx Reference: http://msdn.microsoft.com/en-us/library/ms177682.aspx Reference: http://msdn.microsoft.com/en-us/library/ms173545.aspx

Download Ensurepass Latest 2013 MCSA 70-461 Real Exam Questions , help you to pass exam 100%.

Comments are closed.