You administer a Microsoft SQL Server database that supports a shopping application. You need to retrieve a
list of customers who live in territories that do not have a sales person. Which Transact- SQL query or queries
should you use? (Each correct answer presents a complete solution. Choose all that apply.)
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?
Your application contains a stored procedure for each country. Each stored procedure accepts an employee
identification number through the @EmpID parameter. You plan to build a single process for each employee
that will execute the stored procedure based on the country of residence. Which approach should you use?
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:
You use Microsoft SQL Server 2012 to write code for a transaction that contains several statements. There is
high contention between readers and writers on several tables used by your transaction. You need to minimize
the use of the tempdb space. You also need to prevent reading queries from blocking writing queries. Which
isolation level should you use?
You are writing a set of queries against a FILESTREAM-enabled database. You create a stored procedure that
will update multiple tables within a transaction. You need to ensure that if the stored procedure raises a run-
time error, the entire transaction is terminated and rolled back. Which Transact-SQL statement should you
include at the beginning of the stored procedure?
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?
You are developing a database application by using Microsoft SQL Server 2012. An application that uses a
database begins to run slowly. Your investigation shows the root cause is a query against a read-only table that
has a clustered index. The query returns the following six columns:
You administer a Microsoft SQL Server 2012 server that hosts a transactional database and a reporting
database. The transactional database is updated through a web application and is operational throughout the
day. The reporting database is only updated from the transactional database. The recovery model and backup
schedule are configured as shown in the following table:
The differential backup of the reporting database fails. Then, the reporting database fails at 14:00 hours. You
need to ensure that the reporting database is restored. You also need to ensure that data loss is minimal. What
should you do?
You administer a Microsoft SQL Server 2012 server that hosts a transactional database and a reporting
database. The transactional database is updated through a web application and is operational throughout the
day. The reporting database is only updated from the transactional database. The recovery model and backup
schedule are configured as shown in the following table:
At 14:00 hours, you discover that pages 71, 520, and 713 on one of the database files are corrupted on the
reporting database. You need to ensure that the databases are restored. You also need to ensure that data loss
is minimal. What should you do?