1.
You administer a Microsoft SQL Server database that has multiple tables in the Sales schema. Some users must be prevented from deleting records in any of the tables in the Sales schema. You need to manage users who are prevented from deleting records in the Sales schema. You need to achieve this goal by using the minimum amount of administrative effort. What should you do?
2.
You administer a Microsoft SQL Server database. The database contains a Product table created by using the following definition: You need to ensure that the minimum amount of disk space is used to store the data in the Product table. What should you do?
3.
You generate a daily report according to the following query: You need to improve the performance of the query. What should you do?
4.
You use a Microsoft SQL Server database that contains a table named BlogEntry that has the following columns: Id is the Primary Key. You need to append the "This is in a draft stage" string to the Summary column of the recent 10 entries based on the values in EntryDateTime. Which Transact-SQL statement should you use?
5.
You use Microsoft SQL Server to develop a database application. You create a stored procedure named DeleteJobCandidate. You need to ensure that if DeleteJobCandidate encounters an error, the execution of the stored procedure reports the error number. Which Transact-SQL statement should you use?
6.
You use Microsoft SQL Server to create a stored procedure as shown in the following code segment. (Line numbers are included for reference only.) The procedure can be called within other transactions. You need to ensure that when the DELETE statement from the HumanResourcesJobCandidate table succeeds, the modification is retained even if the insert into the Audit.Log table fails. Which code segment should you add to line 14?
7.
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 preceding year. Which Transact-SQL query should you use?
8.
You use Microsoft SQL Server to develop a database application. Your application sends data to an NVARCHAR(MAX) variable named @var. You need to write a Transact-SQL statement that will find out the success of a cast to a DECIMAL (36,9). Which code segment should you use?
9.
You develop a Microsoft SQL Server 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?
10.
You develop a Microsoft SQL Server server database that supports an application. The application contains a table that has the following definition:
CREATE TABLE Inventory
(
ItemID int NOT NULL PRIMARY KEY,
ItemsInStore int NOT NULL,
ItemsInWarehouse int NOT NULL
)
You need to create a computed column that returns the sum total of the ItemsInStore and ItemsInWarehouse values for each row. The new column is expected to be queried heavily, and you need to be able to index the column. Which Transact-SQL statement should you use?