The Microsoft 70-462 Practice Exam is a very hard exam to successfully pass your exam.Here you will find Free Braindump2go Microsoft Practice Sample Exam Test Questions that will help you prepare in passing the 70-462 exam.Braindump2go Guarantees you 100% PASS exam 70-462

Vendor: Microsoft
Exam Code: 70-462
Exam Name: Administering Microsoft SQL Server 2012 Databases Exam

11022

QUESTION 176
You develop a database for a travel application.
You need to design tables and other database objects.
You create a view that displays the dates and times of the airline schedules on a report.
You need to display dates and times in several international formats.
What should you do?

A.    Use the CAST function.
B.    Use the DATE data type.
C.    Use the FORMAT function.
D.    Use an appropriate collation.
E.    Use a user-defined table type.
F.    Use the VARBINARY data type.
G.    Use the DATETIME data type.
H.    Use the DATETIME2 data type.
I.    Use the DATETIMEOFFSET data type.
J.    Use the TODATETIMEOFFSET function.

Answer: C
Explanation:
http://msdn.microsoft.com/en-us/library/hh213505.aspx

QUESTION 177
You have three tables that contain data for vendors, customers, and agents.
You create a view that is used to look up telephone numbers for these companies.
The view has the following definition:
You need to ensure that users can update only the phone numbers by using this view.
What should you do?

A.    Alter the view. Use the EXPAND VIEWS query hint along with each SELECT statement.
B.    Drop the view. Re-create the view by using the SCHEMABINDING clause, and then create
an index on the view.
C.    Create an AFTER UPDATE trigger on the view.
D.    Create an INSTEAD OF UPDATE trigger on the view.

Answer: D

QUESTION 178
You develop a Microsoft SQL Server 2012 database that contains tables named Employee and Person.
The tables have the following definitions:

wpsCE8D.tmp_thumb

You create a view named VwEmployee as shown in the following Transact-SQL statement.

wpsE7F7.tmp_thumb

Users are able to use single INSERT statements or INSERT…SELECT statements into this view. You need to ensure that users are able to use a single statement to insert records into both Employee and Person tables by using the VwEmployee view.
Which Transact-SQL statement should you use?

A.    CREATE TRIGGER TrgVwEmployee
ON VwEmployee
FOR INSERT
AS
BEGIN
INSERT INTO Person(Id, FirstName, LastName)
SELECT Id, FirstName, LastName, FROM inserted
INSERT INTO Employee(PersonId, EmployeeNumber)
SELECT Id, EmployeeNumber FROM inserted
END
B.    CREATE TRIGGER TrgVwEmployee
ON VwEmployee
INSTEAD OF INSERT
AS
BEGIN
INSERT INTO Person(Id, FirstName, LastName)
SELECT Id, FirstName, LastName, FROM inserted
INSERT INTO Employee(PersonId, EmployeeNumber)
SELECT Id, EmployeeNumber FROM inserted
END
C.    CREATE TRIGGER TrgVwEmployee
ON VwEmployee
INSTEAD OF INSERT
AS
BEGIN
DECLARE @ID INT, @FirstName NVARCHAR(25), @LastName NVARCHAR(25), @PersonID INT,
@EmployeeNumber NVARCHAR(15)
SELECT @ID = ID, @FirstName = FirstName, @LastName = LastName, @EmployeeNumber =
EmployeeNumber
FROM inserted
INSERT INTO Person(Id, FirstName, LastName)
VALUES(@ID, @FirstName, @LastName)
INSERT INTO Employee(PersonID, EmployeeNumber)
VALUES(@PersonID, @EmployeeNumber
End
D.    CREATE TRIGGER TrgVwEmployee
ON VwEmployee
INSTEAD OF INSERT
AS
BEGIN
INSERT INTO Person(Id, FirstName, LastName)
SELECT Id, FirstName, LastName FROM VwEmployee
INSERT INTO Employee(PersonID, EmployeeNumber)
SELECT Id, EmployeeNumber FROM VwEmployee
End

Answer: B

QUESTION 179
You develop a Microsoft SQL Server 2012 database.
You create a view from the Orders and OrderDetails tables by using the following definition.
You need to improve the performance of the view by persisting data to disk.
What should you do?

A.    Create an INSTEAD OF trigger on the view.
B.    Create an AFTER trigger on the view.
C.    Modify the view to use the WITH VIEW_METADATA clause.
D.    Create a clustered index on the view.

Answer: D
Explanation:
http://msdn.microsoft.com/en-us/library/ms188783.aspx

QUESTION 180
Your database contains tables named Products and ProductsPriceLog.
The Products table contains columns named ProductCode and Price.
The ProductsPriceLog table contains columns named ProductCode, OldPrice, and NewPrice. The ProductsPriceLog table stores the previous price in the OldPrice column and the new price in the NewPrice column.
You need to increase the values in the Price column of all products in the Products table by 5 percent.
You also need to log the changes to the ProductsPriceLog table.
Which Transact-SQL query should you use?

A.    UPDATE Products SET Price = Price * 1.05
OUTPUT inserted.ProductCode, deleted.Price, inserted.Price INTO ProductsPriceLog(ProductCode,
OldPrice, NewPrice)
B.    UPDATE Products SET Price = Price * 1.05
OUTPUT inserted.ProductCode, inserted.Price, deleted.Price INTO ProductsPriceLog(ProductCode,
OldPrice, NewPrice)
C.    UPDATE Products SET Price = Price * 1.05
OUTPUT inserted.ProductCode, deleted.Price, inserted.Price * INTO ProductsPriceLog(ProductCode,
OldPrice, NewPrice)
D.    UPDATE Products SET Price = Price * 1.05
INSERT INTO ProductsPriceLog (ProductCode, CldPnce, NewPrice; SELECT ProductCode, Price,
Price * 1.05 FROM Products

Answer: A
Explanation:
http://msdn.microsoft.com/en-us/library/ms177564.aspx

QUESTION 181
A table named Profits stores the total profit made each year within a territory.
The Profits table has columns named Territory, Year, and Profit.
You need to create a report that displays the profits made by each territory for each year and its previous year.
Which Transact-SQL query should you use?

A.    SELECT Territory, Year, Profit,
LEAD(Profit, 1, 0) OVER (PARTITION BY Territory ORDER BY Year) AS PrevProfit FROM Profits
B.    SELECT Territory, Year, Profit,
LAG(Profit, 1, 0) OVER (PARTITION BY Year ORDER BY Territory) AS PrevProfit FROM Profits
C.    SELECT Territory, Year, Profit,
LAG(Profit, 1, 0) OVER (PARTITION BY Territory ORDER BY Year) AS PrevProfit FROM Profits
D.    SELECT Territory, Year, Profit,
LEAD(Profit, 1, 0) OVER (PARTITION BY Year ORDER BY Territory) AS PrevProfit FROM Profits

Answer: C
Explanation:
http://msdn.microsoft.com/en-us/library/hh231256.aspx
http://msdn.microsoft.com/en-us/library/hh213125.aspx

QUESTION 182
Your database contains a table named SalesOrders.
The table includes a DATETIME column named OrderTime that stores the date and time each order is placed.  There is a non-clustered index on the OrderTime column. The business team wants a report that displays the total number of orders placed 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?

A.    SELECT COUNT(*) FROM SalesOrders
WHERE OrderTime = CONVERT(DATE, GETDATE())
B.    SELECT COUNT(*) FROM SalesOrders
WHERE OrderTime = GETDATE()
C.    SELECT COUNT(*) FROM SalesOrders
WHERE CONVERT(VARCHAR, OrderTime, 112) = CONVERT(VARCHAR, GETDATE(I, 112))
D.    SELECT COUNT(*) FROM SalesOrders
WHERE OrderTime >= CONVERT(DATE, GETDATE())
AND OrderTime < DATEADD(DAY, CONVERT(DATE, GETDATE()))

Answer: D

QUESTION 183
You use Microsoft SQL Server 2012 to develop a database application.
You create a stored procedure named dbo.ModifyData that can modify rows.
You need to ensure that when the transaction fails, dbo.ModifyData meets the following requirements:
– Does not return an error
– Closes all opened transactions
Which Transact-SQL statement should you use?

A.    BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ TRANCOUNT = 0
ROLLBACK TRANSACTION;
END CATCH
B.    BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ERROR != 0
ROLLBACK TRANSACTION;
THROW;
END CATCH
C.    BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@TRANCOUNT = 0
ROLLBACK TRANSACTION;
THROW;
END CATCH
D.    BEGIN TRANSACTION
BEGIN TRY
EXEC dbo.ModifyData
COMMIT TRANSACTION
END TRY
BEGIN CATCH
IF @@ERROR != 0
ROLLBACK TRANSACTION;
END CATCH

Answer: D

QUESTION 184
You are developing a database application by using Microsoft SQL Server 2012.
You have a query that runs slower than expected.
You need to capture execution plans that will include detailed information on missing indexes recommended by the query optimizer.
What should you do?

A.    Add a HASH hint to the query.
B.    Add a LOOP hint to the query.
C.    Add a FORCESEEK hint to the query.
D.    Add an INCLUDE clause to the index.
E.    Add a FORCESCAN hint to the Attach query.
F.    Add a columnstore index to cover the query.
G.    Enable the optimize for ad hoc workloads option.  
H.     Cover the unique clustered index with a columnstore index.
I.      Include a SET FORCEPLAN ON statement before you run the query.
J.     Include a SET STATISTICS PROFILE ON statement before you run the query.
K.    Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.
L.    Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before
you run the query.
M.    Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run
the query.
N.    Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you
run the query.

Answer: K

QUESTION 185
You are developing a database application by using Microsoft SQL Server 2012.
An application that uses a database begins to run slowly.
You discover that a large amount of memory is consumed by single-use dynamic queries.
You need to reduce procedure cache usage from these statements without creating any additional indexes.
What should you do?

A.    Add a HASH hint to the query.
B.    Add a LOOP hint to the query.
C.    Add a FORCESEEK hint to the query.
D.    Add an INCLUDE clause to the index.
E.    Add a FORCESCAN hint to the Attach query.
F.    Add a columnstore index to cover the query.
G.    Enable the optimize for ad hoc workloads option.  
H.     Cover the unique clustered index with a columnstore index.
I.      Include a SET FORCEPLAN ON statement before you run the query.
J.     Include a SET STATISTICS PROFILE ON statement before you run the query.
K.    Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.
L.    Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before
you run the query.
M.    Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run
the query.
N.    Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you
run the query.

Answer: G
Explanation:
http://msdn.microsoft.com/en-us/library/cc645587.aspx

QUESTION 186
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for students.
The table has marks obtained by 50 students for various subjects.
You need to ensure that the top half of the students arranged by their average marks must be given a rank of 1 and the remaining students must be given a rank of 2.
Which Transact-SQL query should you use?

A.    SELECT StudentCode as Code,
RANK() OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
B.    SELECT Id, Name, Marks,
DENSE_RANK() OVER (ORDER BY Marks DESC) AS Rank
FROM StudentMarks
C.    SELECT StudentCode as Code,
DENSE_RANK() OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
D.    SELECT StudentCode as Code,
NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
E.    SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks,
RANK() OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
F.    SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks,
RANK() OVER (PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
G.    SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks,
RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1
H.    SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode, Marks AS Marks,
RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks) tmp
WHERE Rank = 1

Answer: D

QUESTION 187
You develop a database for a travel application.
You need to design tables and other database objects.
You create the Airline_Schedules table.
You need to store the departure and arrival dates and times of flights along with time zone information.
What should you do?

A.    Use the CAST function.
B.    Use the DATE data type.
C.    Use the FORMAT function.
D.    Use an appropriate collation.
E.    Use a user-defined table type.
F.    Use the VARBINARY data type.
G.    Use the DATETIME data type.
H.    Use the DATETIME2 data type.
I.    Use the DATETIMEOFFSET data type.
J.    Use the TODATETIMEOFFSET function.

Answer: I
Explanation:
http://msdn.microsoft.com/en-us/library/ff848733.aspx
http://msdn.microsoft.com/en-us/library/bb630289.aspx

QUESTION 188
You develop a database for a travel application.
You need to design tables and other database objects.
You create a stored procedure.
You need to supply the stored procedure with multiple event names and their dates as parameters.
What should you do?

A.    Use the CAST function.
B.    Use the DATE data type.
C.    Use the FORMAT function.
D.    Use an appropriate collation.
E.    Use a user-defined table type.
F.    Use the VARBINARY data type.
G.    Use the DATETIME data type.
H.    Use the DATETIME2 data type.
I.    Use the DATETIMEOFFSET data type.
J.    Use the TODATETIMEOFFSET function.

Answer: E

QUESTION 189
You develop a Microsoft SQL Server 2012 database.
The database is used by two web applications that access a table named Products.
You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data.
You need to ensure that the following requirements are met:
Future modifications to the table definition will not affect the applications’ ability to access data.
The new object can accommodate data retrieval and data modification.
You need to achieve this goal by using the minimum amount of changes to the applications.
What should you create for each application?

A.    Synonyms
B.    Common table expressions
C.    Views
D.    Temporary tables

Answer: C
Explanation:
http://msdn.microsoft.com/en-us/library/ms190174.aspx

QUESTION 190
You are designing a SQL Server Integration Services (SSIS) package that uses the Fuzzy Lookup transformation.
The reference data to be used in the transformation does not change.
You need to reuse the Fuzzy Lookup match index to increase performance and reduce maintenance.
What should you do?

A.    Select the GenerateAndPersistNewIndex option in the Fuzzy Lookup Transformation Editor.
B.    Select the GenerateNewIndex option in the Fuzzy Lookup Transformation Editor.
C.    Select the DropExistingMatchlndex option in the Fuzzy Lookup Transformation Editor.
D.    Execute the sp_FuzzyLookupTableMaintenanceUninstall stored procedure
E.     Execute the sp_FuzzyLookupTableMaintenanceInvoke stored procedure.

Answer: A
Explanation:
http://msdn.microsoft.com/en-us/library/ms137786.aspx


Braindump2go Regular Updates of Microsoft 70-462 Preparation Materials Exam Dumps, with Accurate Answers, Keeps the Members One Step Ahead in the Real 70-462 Exam. Field Experts with more than 10 Years Experience in Certification Field work with us.

1522

http://www.braindump2go.com/70-462.html