PrepAway - Latest Free Exam Questions & Answers

Author: admin

Which trigger syntax should you use?

You are developing a database using Microsoft SQL Server 2008. The database contains the tables shown in the exhibit. You are required to prevent parts from being deleted if they belong to a kit. If a part belongs to a kit, the delete should not occur and the IsDeleted column for the row should be changed to ‘True’. Parts can be deleted if they do not belong to a kit. You have the following Transact-SQL statement to be used in a trigger:

UPDATE p SET IsDeleted = 1 FROM KitPart kp
JOIN deleted d ON kp.PartID = d.PartID
JOIN Part p ON kp.PartID = p.PartID; DELETE FROM p FROM Part p
JOIN deleted d ON p.PartID = d.PartID
LEFT OUTER JOIN KitPart kp ON p.PartID = kp.PartID WHERE kp.KitID IS NULL;

You need to implement the Transact-SQL statement in a trigger. Which trigger syntax should you use?

Exhibit:

Which index should you create?

You administer a SQL Server 2008 database that contains a table name dbo.Sales, which contains the following table definition:

CREATE TABLE [dbo].[Sales](
[SalesID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
[OrderDate] [datetime] NOT NULL,
[CustomerID] [int] NOT NULL,
[SalesPersonID] [int] NULL,
[CommentDate] [date] NULL);

This table contains millions of orders. You run the following query to determine when sales persons comment in the dbo.Sales table:

SELECT SalesID,CustomerID,SalesPersonID,CommentDate FROM dbo.Sales
WHERE CommentDate IS NOT NULL AND SalesPersonID IS NOT NULL;

You discover that this query runs slow. After examining the data, you find only 1% of rows have comment dates and the SalesPersonID is null on 10% of the rows. You need to create an index to optimize the query. The index must conserve disk space while optimizing your query. Which index should you create?

Which three actions should you perform, and in what order?

A server named CK-LDS1 resides in the CertKiller LAN and has the Active Directory Domain Services (AD DS) role and the Active Directory Lightweight Directory Services (AD LDS) role installed.
An AD LDS instance named CKLDS1 stores its data on the default application directory partition. The drive letters, size and space available on the CK-LDS1 server are configured as shown in the table exhibit.
You find that the AD LDS database files are growing quickly, so you decide to relocate the AD LDS application partition to the D: drive where more space is available. Which three actions should you perform, and in what order? Note: Some answer choices will not be used.
exhibit