Microsoft 70-461 Exam Practice Questions (P. 4)
- Full Access (265 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #16
You develop a Microsoft SQL Server database.
You need to create a batch process that meets the following requirements:
✑ Returns a result set based on supplied parameters.
✑ Enables the returned result set to perform a join with a table.
Which object should you use?
You need to create a batch process that meets the following requirements:
✑ Returns a result set based on supplied parameters.
✑ Enables the returned result set to perform a join with a table.
Which object should you use?
- AInline user-defined function
- BStored procedure
- CTable-valued user-defined function
- DScalar user-defined function
Correct Answer:
C
C
send
light_mode
delete
Question #17
You develop a Microsoft SQL Server database.
You need to create and call a stored procedure that meets the following requirements:
✑ Accepts a single input parameter for CustomerID.
✑ Returns a single integer to the calling application.
Which two Transact-SQL statements should you use? Each correct answer presents part of the solution.
You need to create and call a stored procedure that meets the following requirements:
✑ Accepts a single input parameter for CustomerID.
✑ Returns a single integer to the calling application.
Which two Transact-SQL statements should you use? Each correct answer presents part of the solution.
- ACREATE PROCEDURE dbo.GetCustomerRating @CustomerID INT, @CustomerRating INT OUTPUT AS SET NOCOUNT ON SELECT @CustomerRating = CustomerOrders/CustomerValue FROM Customers WHERE CustomerID = @CustomerID RETURN GO
- BEXECUTE dbo.GetCustomerRating 1745
- CDECLARE @CustomerRatingByCustomer INT DECLARE @Result INT EXECUTE @Result = dbo.GetCustomerRating 1745, @CustomerRatingByCustomer
- DCREATE PROCEDURE dbo.GetCustomerRating @CustomerID INT, @CustomerRating INT OUTPUT AS SET NOCOUNT ON SELECT @Result = CustomerOrders/CustomerValue FROM Customers WHERE CustomerID = @CustomerID RETURN @Result GO
- EDECLARE @CustomerRatingByCustomer INT EXECUTE dbo.GetCustomerRating @CustomerID = 1745, @CustomerRating = @CustomerRatingByCustomer OUTPUT
- FCREATE PROCEDURE dbo.GetCustomerRating @CustomerID INT AS DECLARE @Result INT SET NOCOUNT ON SELECT @Result = CustomerOrders/CustomerValue FROM Customers WHERE CustomerID = @CustomerID
Correct Answer:
AE
AE
send
light_mode
delete
Question #18
You develop a Microsoft SQL Server database that contains a heap named OrdersHistorical.
You write the following Transact-SQL query:
INSERT INTO OrdersHistorical -
SELECT * FROM CompletedOrders -
You need to optimize transaction logging and locking for the statement. Which table hint should you use?
You write the following Transact-SQL query:
INSERT INTO OrdersHistorical -
SELECT * FROM CompletedOrders -
You need to optimize transaction logging and locking for the statement. Which table hint should you use?
- AHOLDLOCK
- BROWLOCK
- CXLOCK
- DUPDLOCK
- ETABLOCK
Correct Answer:
E
Reference:
http://technet.microsoft.com/en-us/library/ms189857.aspx
http://msdn.microsoft.com/en-us/library/ms187373.aspx
E
Reference:
http://technet.microsoft.com/en-us/library/ms189857.aspx
http://msdn.microsoft.com/en-us/library/ms187373.aspx
send
light_mode
delete
Question #19
You use a Microsoft SQL Server database that contains two tables named SalesOrderHeader and SalesOrderDetail. The indexes on the tables are as shown in the exhibit. (Click the Exhibit tab.)

You write the following Transact-SQL query:

You discover that the performance of the query is slow. Analysis of the query plan shows table scans where the estimated rows do not match the actual rows for
SalesOrderHeader by using an unexpected index on SalesOrderDetail.
You need to improve the performance of the query.
What should you do?

You write the following Transact-SQL query:

You discover that the performance of the query is slow. Analysis of the query plan shows table scans where the estimated rows do not match the actual rows for
SalesOrderHeader by using an unexpected index on SalesOrderDetail.
You need to improve the performance of the query.
What should you do?
- AUse a FORCESCAN hint in the query.
- BAdd a clustered index on SalesOrderID in SalesOrderHeader.
- CUse a FORCESEEK hint in the query.
- DUpdate statistics on SalesOrderID on both tables.
Correct Answer:
D
References:
http://msdn.microsoft.com/en-us/library/ms187348.aspx
D
References:
http://msdn.microsoft.com/en-us/library/ms187348.aspx
send
light_mode
delete
Question #20
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?
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?
- ASELECT COUNT(*) FROM Purchases WHERE PurchaseTime = CONVERT(DATE, GETDATE())
- BSELECT COUNT(*) FROM Purchases WHERE PurchaseTime = GETDATE()
- CSELECT COUNT(*) FROM Purchases WHERE CONVERT(VARCHAR, PurchaseTime, 112) = CONVERT(VARCHAR, GETDATE(), 112)
- DSELECT COUNT(*) FROM Purchases WHERE PurchaseTime >= CONVERT(DATE, GETDATE()) AND PurchaseTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))
Correct Answer:
D
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.
Reference:
http://technet.microsoft.com/en-us/library/ms181034.aspx
D
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.
Reference:
http://technet.microsoft.com/en-us/library/ms181034.aspx
send
light_mode
delete
All Pages