PrepAway - Latest Free Exam Questions & Answers

Category: 70-433

Exam 70-433: TS: Microsoft SQL Server 2008, Database Development

Which Transact-SQL statement should you use?

Click the Exhibit button.

You have the following XML:
<Site URL="http://www.contoso.com/index.htm">
<Site URL="http://www.contoso.com/finance/index.htm">
<Site URL="http://www.contoso.com/finance/reports/index.htm" />
<Site URL="http://www.contoso.com/finance/main/index.htm" />
</Site>
<Site URL="http://www.contoso.com/marketing/index.htm">
<Site URL="http://www.contoso.com/marketing/reports/index.htm" />
<Site URL="http://www.contoso.com/marketing/main/index.htm" />
</Site>
<Site URL="http://www.contoso.com/sales/index.htm" />
</Site>

You are tasked to query the sites listed in the XML by using OPENXML.
The results will have two columns, ParentSiteURL and SiteURL.
The ParentSiteURL column should contain the URL attribute of the parent site.
The SiteURL column should contain the URL attribute of the site itself.
The output should look like that in the exhibit.
You need to write the OPENXML query.
Which Transact-SQL statement should you use?

Exhibit:

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?


Page 1 of 1412345...10...Last »