Which Transact-SQL statement should you use?
You have a table named Sales.PotentialClients. This table contains a column named EmailAddress.
You are tasked to develop a report that returns valid ".com" email addresses from Sales.PotentialClients.
A valid email address must have at least one character before the @ sign, and one character after the @ sign and before the ".com."
You need to write a Transact-SQL statement that returns data to meet the business requirements.
Which Transact-SQL statement should you use?
Which Transact-SQL statement should you use?
You have a table named Sales.SalesOrderHeader and a table named Person.Person. You are tasked to write a query that returns SalesOrderID and SalesPersonName that have an OrderDate greater than 20040101. SalesPersonName should be made up by concatenating the columns named FirstName and LastName from the table named Person.Person. You need to write a query to return data, sorted in alphabetical order, by the concatenation of FirstName and LastName. Which Transact-SQL statement should you use?
Which query should you use?
You have the following table named Sales.
You need to return sales data ordered by customer name and date of sale. For each customer, the most recent sale must be listed first.
Which query should you use?
Which query should you use?
You have a table named JobCandidate. You are tasked to delete a row in the JobCandidate table. You need to write a transaction that allows the database to be restored to the exact point the record was deleted without knowing the time of execution. Which query should you use?
Which option should you enable?
You are writing a batch that contains multiple UPDATE statements to modify existing products. You have placed these updates into one explicit transaction. You need to set an option at the beginning of the transaction to roll back all changes if any of the updates in the transaction fail. Which option should you enable?
Which transaction isolation level should you use?
You have a transaction that uses the repeatable read isolation level.
This transaction causes frequent blocking problems. You need to reduce blocking. You also need to avoid dirty reads and non-repeatable reads.
Which transaction isolation level should you use?
Which Transact-SQL statement should you insert at line 07?
You have a table named Orders. You have been tasked to modify your company’s main database to remove all inactive order rows. You are developing a stored procedure that will enable you to delete these rows. You have written the following code segment to accomplish this task. (Line numbers are included for reference only.) 01 BEGIN TRY
02 DECLARE @RowCount INT = 1000
03 WHILE @RowCount = 1000
04 BEGIN
05 DELETE TOP (1000) FROM Orders WHERE Status = ‘Inactive’;
06 SET @RowCount = @@ROWCOUNT
07 …
08 END
09 END TRY
10 BEGIN CATCH
11 PRINT ERROR_MESSAGE()
12 END CATCH
You need to insert a Transact-SQL statement that will notify you immediately after each batch of rows is deleted. Which Transact-SQL statement should you insert at line 07?
Which severity level should you use?
You are using TRY…CATCH error handling.
You need to raise an error that will pass control to the CATCH block.
Which severity level should you use?
What should be the expected outcome?
You have tables named Products and OrderDetails. The Products table has a foreign key relationship
with the OrderDetails table on the ProductID column. You have the following Transact-SQL batch:
BEGIN TRY
BEGIN TRANSACTION
DELETE FROM Products WHERE ProductID = 5;
BEGIN TRANSACTION
INSERT INTO OrderDetails
( OrderID, ProductID, Quantity )
VALUES
( 1234, 5, 12 );
COMMIT TRANSACTION
COMMIT TRANSACTION
END TRY
BEGIN CATCH ROLLBACK TRANSACTION PRINT ERROR_MESSAGE();
END CATCH
You need to analyze the result of executing this batch. What should be the expected outcome?
Which permission set should you use?
You have created an assembly that utilizes unmanaged code to access external resources.
You need to deploy the assembly with the appropriate permissions.
Which permission set should you use?