DWR
DWR
EXAM 70-433
TS: Microsoft SQL Server 2008, Database Development
http://www.exam1pass.com/70-433-exam.html
Question: 1
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database for an inventory management system. The application contains a product table that has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, [Style] [nchar](2) NULL, [Active] [bit] NOT NULL, [ModifiedDate] [datetime] NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ( [ProductID] ASC ) ON [PRIMARY]) ON [PRIMARY]GO You want to add a new field to the Product table to meet the following requirements: Allows user-specified information that will be added to records in the Product table. Supports the largest storage size needed for the field. Uses the smallest data type necessary to support the domain of values that will be entered by users. You need to add a field named User_Data_1 to support Unicode string values that have a minimum length of two characters and a maximum length of 100 characters. Which SQL statement should you use? A. ALTER TABLE [Production].[Product] ADD [User_Data_1] NCHAR(100) B. ALTER TABLE [Production].[Product] ADD [User_Data_1] NUMERIC(11,6) C. ALTER TABLE [Production].[Product] ADD [User_Data_1] VARCHAR(100) D. ALTER TABLE [Production].[Product] ADD [User_Data_1] MONEY E. ALTER TABLE [Production].[Product] ADD [User_Data_1] SMALLMONEY F. ALTER TABLE [Production].[Product] ADD [User_Data_1] DATE G. ALTER TABLE [Production].[Product] ADD [User_Data_1] INT H. ALTER TABLE [Production].[Product] ADD [User_Data_1] BIGINT I. ALTER TABLE [Production].[Product] ADD [User_Data_1] TINYINT J. ALTER TABLE [Production].[Product] ADD [User_Data_1] NVARCHAR(100) K. ALTER TABLE [Production].[Product] ADD [User_Data_1] CHAR(100) L. ALTER TABLE [Production].[Product] ADD [User_Data_1] NUMERIC(6,11) M. ALTER TABLE [Production].[Product] ADD [User_Data_1] DATETIME2 N. ALTER TABLE [Production].[Product] ADD [User_Data_1] DATETIME O. ALTER TABLE [Production].[Product] ADD [User_Data_1] BIT P. ALTER TABLE [Production].[Product] ADD [User_Data_1] SMALLINT Q. ALTER TABLE [Production].[Product] ADD [User_Data_1] SMALLDATETIME Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
1 1
Answer: J Question: 2
You are the database developer for a Microsoft SQL Server 2008 database that contains tables named order and product. The tables have the following definitions: CREATE TABLE [order] (OrderID INT, ProductID INT, CustomerID INT, OrderDate DATETIME); CREATE TABLE product (ProductID INT, ProductName VARCHAR(100), SalePrice money, ManufacturerName VARCHAR(100)); You need to write a query that will extract a valid XML result set of all ordered products. You also need to ensure that the query conforms to the following schema: <?xml version="1.0" encoding="utf-16"?><xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="OrderedProducts"> <xsd:complexType> <xsd:sequence> <xsd:element name="ProductID" type="xsd:int" /> <xsd:element name="ProductName" type="xsd:string" /> <xsd:element name="SalePrice" type="xsd:decimal" /> <xsd:element name="ManufacturerName" type="xsd:string" /> <xsd:element name="OrderDate" type="xsd:dateTime" /> </xsd:sequence> </xsd:complexType> </xsd:element></xsd:schema> Which SQL query should you use? A. SELECTp.ProductID,p.ProductName,p.SalePrice,p.ManufacturerName,o.OrderDateFROMproduct p INNER JOIN[order] o ON p.ProductID = o.ProductIDFOR XML AUTO ('OrderedProducts'); B. SELECTp.ProductID,p.ProductName,p.SalePrice,p.ManufacturerName,o.OrderDateFROMproduct p INNER JOIN[order] o ON p.ProductID = o.ProductIDFOR XML AUTO; C. SELECTp.ProductID,p.ProductName,p.SalePrice,p.ManufacturerName,o.OrderDateFROMproduct p INNER JOIN[order] o ON p.ProductID = o.ProductIDFOR XML PATH ('OrderedProducts'); D. SELECT'<OrderedProducts>',p.ProductID,p.ProductName,p.SalePrice,p.ManufacturerName,o.Ord erDate,'</OrderedProducts>'FROMproduct p INNER JOIN[order] o ON p.ProductID = o.ProductIDFOR XML PATH; Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
2 2
Answer: C OR E Question: 3
You are a database developer writing reports for a sales management application. A customer table has the following definition: CREATE TABLE customer (CustomerID INT, FirstName VARCHAR(30), LastName VARCHAR(50), StreetAddress VARCHAR(100), City VARCHAR(100), [State] VARCHAR(25), PostalCode VARCHAR(5)); An order table has the following definition: CREATE TABLE [order] (OrderID INT, ProductID INT, CustomerID INT, OrderDate DATETIME); You need to write a report that contains the following columns: Column name CustomerID FullName Postalcode OrderCount Description The CustomerID Concatenated first and last names Customers Postal Code Number of orders for this customer
EarliestOrderDate The OrderDate from the earliest (by OrderDate) order for this customer Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
3 3
Answer: A OR C
Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
4 4
Question: 4
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database named AdventureWorks that contains a table named Production.Product. The table contains a primary key named PK_Product_ProductID and a non-clustered index named AK_Product_ProductNumber. Both indexes have been created on a single primary partition. The table has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, [Style] [nchar](2) NULL, [ModifiedDate] [datetime] NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ( [ProductID] ASC ) ON [PRIMARY]) ON [PRIMARY]GO The index has the following definition: CREATE UNIQUE NONCLUSTERED INDEX [AK_Product_ProductNumber] ON [Production].[Product] ( [ProductNumber] ASC) ON [PRIMARY]GO The Production.Product table contains 1 million rows. You want to ensure that data retrieval takes the minimum amount of time when the queries executed against the Production.Product table are ordered by product number or filtered by class. You need to find out the degree of fragmentation for the indexes on the Production.Product table. Which Transact-SQL statement should you use? A. ALTER STATISTICS Production.Product B. SELECT * FROM sys.indexes where name=N'Production.Product' C. CREATE STATISTICS ProductClass_StatsON Production.Product (Name, ProductNumber, Class)WHERE Class is not null D. SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID(N'Production.Product'),NULL, NULL, NULL) E. SELECT * FROM STATS WHERE name='AK_Product_ProductNumber' F. DBCC SHOW_STATISTICS ('Production.Product', AK_Product_ProductNumber) G. UPDATE INDEX AK_Product_ProductNumber ON Production.Product SET (STATISTICS_NORECOMPUTE = ON) H. ALTER INDEX AK_Product_ProductNumber ON Production.Product REBUILD I. SELECT * FROM sys.dm_db_index_operational_stats (DB_ID(), OBJECT_ID(N'Production.Product'),NULL, NULL) J. SELECT * FROM SYS.STATS WHERE name='AK_Product_ProductNumber' K. EXEC sys.sp_configure 'index create memory', 1 L. CREATE STATS ProductClass_StatsON Production.Product (Name, ProductNumber, Class)WHERE Class is not nullWITH SAMPLE 100 PERCENT Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
5 5
Answer: D Question: 5
A table named Contacts includes a column named SmtpAddress. You must develop a report that returns e-mail addresses from the Contacts table that have the following format: at least one character, the at sign (@), at least one character, and then ".org". You need to return data that meets the requirements. Which Transact-SQL statement should you use? A. select * from Contacts where SmtpAddress like '%@%.org' B. select * from Contacts where SmtpAddress like '_%@_%.org' C. select * from Contacts where SmtpAddress like '_%@_.org' D. select * from Contacts where SmtpAddress like '%@%[.]org'
Answer: B Question: 6
You have a column named TelephoneNumber that stores numbers as varchar(20). You need to write a query that returns the first three characters of a telephone number. Which expression should you use? A. CHARINDEX('[0-9][0-9][0-9]', TelephoneNumber, 3) B. SUBSTRING(TelephoneNumber, 3, 3) C. SUBSTRING(TelephoneNumber, 3, 1) D. LEFT(TelephoneNumber, 3)
Answer: D Question: 7
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database named AdventureWorks that contains a table named Production.Product. The table contains a primary key named PK_Product_ProductID and a non-clustered index named AK_Product_ProductNumber. Both indexes have been created on a single primary partition. The table has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
6 6
Answer: N Question: 8
You are using SQL Server Profiler to gather deadlock information. You need to capture an XML description of a deadlock. Which event should you use? A. Showplan XML B. Lock:Deadlock Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
7 7
Answer: C Question: 9
You develop a new stored procedure for an existing database. You create two tables named Customer and Orders. The tables have the following definitions: CREATE TABLE Customer (CustomerID int NOT NULL PRIMARY KEY CLUSTERED, CustomerName nvarchar(255) NOT NULL, CustomerAddress nvarchar (1024) NOT NULL) CREATE TABLE Orders (OrderID int NOT NULL PRIMARY KEY CLUSTERED, CustomerID int NOT NULL FOREIGN KEY REFERENCES Customer(CustomerID), OrderDetails nvarchar(MAX)) Users are restricted from accessing table objects directly. You need to ensure that users are able to retrieve customer data. You need to create a stored procedure that meets the following requirements: Returns a row that contains the name, address, and number of orders made by a customer by specifying the CustomerID value. Returns a row even if the customer has made no orders. Does not return a row if the CustomerID does not exist. Which Transact-SQL statement or statements should you use? A. INSERT INTO Tickets VALUES (4, 'sales', 'open', 0), (5, 'support', 'open', 0), (6, 'support', 'open', 1) B. UPDATE TicketsSET IsArchived = 1WHERE TicketId IN (1, 2, 3) C. CREATE PROCEDURE p_GetTotalOrdersByCustomer (@customerid int)AS SELECT c.CustomerName, c.CustomerAddress, TotalOrders = COUNT(o.OrderID)FROM Customer cINNER JOIN Orders oON c.CustomerID = o.CustomerIDGROUP BY c.CustomerName, c.CustomerAddressWHERE c.CustomerID = @customerid GO D. CREATE PROCEDURE p_GetTotalOrdersByCustomer (@customerid int)AS SELECT c.CustomerName, c.CustomerAddress,TotalOrders = SUM(o.OrderID)FROM Customer cINNER JOIN Orders oON c.CustomerID = o.CustomerIDGROUP BY c.CustomerName, c.CustomerAddress GO E. INSERT INTO SupportTickets VALUES (4, 'support', 'open', 0), (5, 'support', 'in progress', 0), (6, 'support', 'closed', 0) F. INSERT INTO Tickets VALUES (4, 'support', 'open', 0), (5, 'support', 'in progress', 0), (6, 'support', 'closed', 0) G. CREATE PROCEDURE p_GetTotalOrdersByCustomer (@customerid int)AS SELECT c.CustomerName, c.CustomerAddress, TotalOrders = ISNULL(o.TotalOrders, 0)FROM Customer cINNER JOIN (SELECT CustomerID, TotalOrders = COUNT(OrderID)FROM OrdersWHERE CustomerID = @customeridGROUP BY CustomerID) oON c.CustomerID = o.CustomerIDWHERE c.CustomerID = @customerid GO H. CREATE PROCEDURE p_GetTotalOrdersByCustomer (@customerid int)AS SELECT c.CustomerName, c.CustomerAddress, TotalOrders = ISNULL(o.TotalOrders, 0)FROM Customer Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
8 8
Answer: B OR F Question: 10
You administer a Microsoft SQL Server 2008 instance that has two databases. The first database named AdventureWorks contains a table named Sales.SalesOrders. The Sales.SalesOrders table has the following definition: CREATE TABLE [Sales].[SalesOrderDetail]( [SalesOrderDetailID] [int] IDENTITY(1,1) NOT NULL, [ProductID] [int] NOT NULL, [OrderQty] [smallint] NOT NULL, [OrderDate] [datetime] NOT NULL, CONSTRAINT [PK_SalesOrderDetail] PRIMARY KEY CLUSTERED ( [SalesOrderDetailID] ASC )) ON [PRIMARY] The second database named AdventureWorksDW contains a table named dbo.SalesOrderSummary. The dbo.SalesOrderSummary table has the following definition: CREATE TABLE [dbo].[SalesOrderSummary] ( ProductID [int] NOT NULL, OrderQty [int] NOT NULL, OrderYear [int] NOT NULL, CONSTRAINT [PK_SalesOrderSummary] PRIMARY KEY CLUSTERED ( OrderYear ASC, ProductID ASC )) ON [PRIMARY] You plan to migrate sales data for the year 2011 from the SalesOrderDetail table into the SalesOrderSummary table. You need to ensure that the following requirements are met: All data is removed from the SalesOrderSummary table before migrating data. A subset of data is migrated from the SalesOrderDetail table in the AdventureWorks database to the SalesOrderSummary table in the AdventureWorksDW database. Migrated data summarizes order quantity in one row per product for the year 2011. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. USE AdventureWorksGO B. USE AdventureWorksDWGO C. DELETE TABLE dbo.SalesOrderSummaryGO D. TRUNCATE TABLE dbo.SalesOrderSummaryGO E. SELECTProductID,SUM(OrderQty) as OrderQty,YEAR(OrderDate) as OrderYear INTOdbo.SalesOrderSummaryFROMAdventureWorks.Sales.SalesOrderDetailWHEREYEAR(OrderD ate)=2011GROUP BYProductID,YEAR(OrderDate)GO F. SELECTProductID,SUM(OrderQty) AS OrderQty,YEAR(2011) AS Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
9 9
Answer: A Question: 12
You administer a Microsoft SQL Server 2008 database that contains a stored procedure named dbo.SalesOrderDetails. The stored procedure has following definition: CREATE PROCEDURE dbo.SalesOrderDetails @CustomerID int, @OrderDate datetime, @SalesOrderID intASSELECT h.SalesOrderID, h.OrderDate, d.OrderQty, d.ProductIDFROM Sales.SalesOrderHeader h INNER JOIN Sales.SalesOrderDetail d ON d.SalesOrderID = h.SalesOrderIDWHERE h.CustomerID = @CustomerID or h.OrderDate > @OrderDate or h.SalesOrderID > @SalesOrderIDGO Parameter values passed to the stored procedure largely Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
10 1
Answer: C OR E Question: 13
You notice that a database server is responding slowly to queries. You run the following dynamic management views (DMV) query on the server. SELECT TOP (10) wait_type, wait_time_msFROM sys.dm_os_wait_statsORDER BY wait_time_ms DESC; The query returns a top wait type of SOS_SCHEDULER_YIELD. You need to identify what is causing the server response issues. Which resource should you investigate first? A. Memory B. Network C. CPU D. Disk
Answer: C Question: 14
You administer a Microsoft SQL Server 2008 database that contains a table named dbo.[order]. There are no triggers on the table. You plan to create a stored procedure that will have the following parameters: @ProdId int @CustId int You need to ensure that the following requirements are met: The OrderID and ProdID values of each modified row are captured into a local table variable before data is modified. The ProdID is modified to @ProdID where CustID is equal to @CustId. Which Transact-SQL statement should you use? A. DECLARE @OrderIDs TABLE (OrderID INT, ProdID INT); UPDATE dbo.[order]SETProdID = @ProdIdOUTPUT DELETED.OrderID, DELETED.ProdID INTO @OrderIDsWHERECustID = @CustId; B. DECLARE @OrderIDs TABLE (OrderID INT, ProdID INT); UPDATE dbo.[order]SETProdID = @ProdIdWHERECustID = @CustId;INSERT into @OrderIDsSELECT SCOPE_IDENTITY(OrderId), SCOPE_IDENTITY(ProdId); C. DECLARE @OrderIDs TABLE (OrderID INT, ProdID INT); UPDATE dbo.[order]SETProdID = Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
11 1
Answer: A OR F Question: 15
You have a table named Inventory. You open a Microsoft Windows PowerShell session at the following location by using the SQL Server Windows PowerShell provider. PS SQLSERVER:\SQL\CONTOSO\DEFAULT\Databases\ReportServer\Tables\dbo.Inventory\Columns> Using the SQL Server Windows PowerShell provider, you need to query all the columns in the table. Which cmdlet should you use? A. Get-ChildItem B. Get-ItemProperty C. Get-Location D. Get-Item
Answer: A Question: 16
You need to ensure that tables are not dropped from your database. What should you do? A. Create a DML trigger that contains ROLLBACK. B. Create a DML trigger that contains COMMIT. C. Create a DDL trigger that contains COMMIT. D. Create a DDL trigger that contains ROLLBACK.
Answer: D Question: 17
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database for an inventory management system. The application contains a product table that has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
12 1
Answer: F Question: 18
You need to round the value 1.75 to the nearest whole number. Which code segment should you use? A. Select ROUND(1.75,1.0) B. Select ROUND(1.75,2) Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
13 1
Answer: C Question: 19
You are the database developer for an order-processing application. The database has the following tables: CREATE TABLE dbo.Product (ProdID INT NOT NULL PRIMARY KEY, ProdName VARCHAR(100) NOT NULL, SalePrice MONEY NOT NULL, ManufacturerName VARCHAR(100) NOT NULL); CREATE TABLE dbo.Customer (CustID INT NOT NULL PRIMARY KEY, CustName VARCHAR(100) NOT NULL, CustAddress VARCHAR(200) NOT NULL, CustCity VARCHAR(100) NOT NULL, CustState VARCHAR(50) NOT NULL, CustPostalCode VARCHAR(5) NOT NULL); CREATE TABLE dbo.[Order](OrderID INT NOT NULL PRIMARY KEY, ProdID INT NOT NULL REFERENCES dbo.Product(ProdId), CustID INT NOT NULL REFERENCES dbo.Customer(CustId), OrderDate DATETIME NOT NULL); You need to ensure that the following requirements are met: Data is loaded into the tables. Data that has been inserted will be removed if any statement fails. No open transactions are performed after the batch has executed. Which Transact-SQL statements should you use? A. BEGIN TRY SAVE TRANSACTION DataLoad INSERT INTO dbo.Product VALUES(1, 'Chair', 146.58, 'Contoso'),(2, 'Table', 458.36, 'Contoso'),(3, 'Cabinet', 398.17, 'Northwind Traders'),(4, 'Desk', 1483.25, 'Northwind Traders'); INSERT INTO dbo.Customer VALUES(1, 'John Smith', '200 West 2nd St', 'Seattle', 'WA', '98060'),(2, 'Bob Jones', '300 Main St', 'Portland', 'OR', '97211'),(3, 'Fred Thomson', '100 Park Ave', 'San Francisco', 'CA', '94172'); INSERT INTO dbo.[Order] VALUES(1, 1, 2, '09/15/2011'),(2, 4, 2, '09/15/2011'),(3, 2, 1, '08/17/2011'),(4, 2, 3, '07/01/2011'),(5, 3, 3, '10/02/2011'); COMMIT TRANSACTION DataLoad; END TRYBEGIN CATCH IF @@TRANCOUNT > 0 BEGINROLLBACK TRANSACTION DataLoad;END; END CATCH; B. BEGIN TRY BEGIN TRANSACTION INSERT INTO dbo.Product VALUES(1, 'Chair', 146.58, 'Contoso'),(2, 'Table', 458.36, 'Contoso'),(3, 'Cabinet', 398.17, 'Northwind Traders'),(4, 'Desk', 1483.25, 'Northwind Traders'); INSERT INTO dbo.Customer VALUES(1, 'John Smith', '200 West 2nd St', 'Seattle', 'WA', '98060'),(2, 'Bob Jones', '300 Main St', 'Portland', 'OR', '97211'),(3, 'Fred Thomson', '100 Park Ave', 'San Francisco', 'CA', '94172'); INSERT INTO dbo.[Order] VALUES(1, 1, 2, '09/15/2011'),(2, 4, 2, '09/15/2011'),(3, 2, 1, '08/17/2011'),(4, 2, 3, '07/01/2011'),(5, 3, 3, '10/02/2011'); COMMIT TRANSACTION; END TRYBEGIN CATCH IF @@TRANCOUNT > 0 BEGINROLLBACK TRANSACTION;END; END CATCH; C. BEGIN TRY BEGIN TRANSACTION customers; INSERT INTO dbo.Product VALUES(1, 'Chair', Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
14 1
15 1
Answer: B OR G Question: 20
You are a developer for a Microsoft SQL Server 2008 R2 database instance. You want to add functionality to an existing application that uses the Microsoft SQL Server Profiler tool to capture trace information. You need to ensure that the following requirements are met: Users are able to use the SQL Server Profiler tool. Users are able to capture trace information and read saved trace files. Users are granted the minimum permissions to achieve these goals. Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.) A. Create a database role named traceusers. B. Add each user of the application to the sysadmin fixed-server role. C. Add each user of the application to the traceusers database role. D. Grant the ALTER TRACE permissions to the traceusers database role. E. Grant the CONTROL SERVER permissions to the traceusers database role. F. Create a server role named traceusers.
16 1
Answer: B OR E
Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
17 1
Question: 22
You administer a Microsoft SQL Server 2008 database that contains a table named Sales.SalesOrderHeader. The Sales.SalesOrderHeader table has the following definition: CREATE TABLE [Sales].[SalesOrderHeader]( [SalesOrderID] [int] IDENTITY(1,1) NOT NULL, [OrderDate] [datetime] NOT NULL, [DueDate] [datetime] NOT NULL, [ShipDate] [datetime] NULL, [Status] [tinyint] NOT NULL, [CustomerID] [int] NOT NULL, [SalesPersonID] [int] NULL, [SubTotal] [money] NOT NULL, [TaxAmt] [money] NOT NULL, CONSTRAINT [PK_OrderHeader_SalesOrderID] PRIMARY KEY CLUSTERED ( [SalesOrderID] ASC ) ) ON [PRIMARY]GO You want to generate an execution plan of XML output document for a query that displays all Sales.SalesOrderHeader records containing orders that have not been shipped. You need to ensure that the following requirements are met: An XML document is provided only for this query. An XML document that contains the estimated execution plan is returned. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. SET SHOWPLAN_XML ON;GO B. SET SHOWPLAN_XML OFF;GO C. SELECT *FROM Sales.SalesOrderHeaderWHERE ShipDate = NULLGO D. SELECT *FROM Sales.SalesOrderHeaderWHERE ShipDate IS NULLGO E. GRANT SHOWPLAN XML ON;GO F. GRANT SHOWPLAN XML OFF;GO G. SET STATISTICS XML ON;GO H. SET STATISTICS XML OFF;GO
18 1
Answer: D Question: 24
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance used to support a customer service application. You create tables named complaint, customer, and product as follows: CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate] [datetime]); CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), [State] [varchar](50), [ZipCode] [varchar](5)); CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), [SalePrice] [money], [ManufacturerName] [varchar](100)); You need to write a query to identify all customers who have complained about products that have an average sales price of 500 or more from September 01, 2011. Which SQL query should you use? A. SELECTc.CustomerName,p.ProductName,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDGROUP BY GROUPING SETS ((c.CustomerName, p.ProductName), ()); B. SELECTc.CustomerName,p.ProductName,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDGROUP BY GROUPING SETS ((c.CustomerName), (p.ProductName), ()); C. SELECTc.CustomerName,COUNT(com.ComplaintID) AS ComplaintsFROMcustomer c INNER JOINcomplaint com ON c.CustomerID = com.CustomerIDWHERECOUNT(com.ComplaintID) > 10GROUP BYc.CustomerName; Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
19 1
Answer: I Question: 25
You have two tables named dbo.Products and dbo.PriceChange. Table dbo.Products contains ten products. Five products are priced at $20 per unit and have PriceIncrease set to 1. The other five products are priced at $10 per unit and have PriceIncrease set to 0. You have the following query: INSERT dbo.PriceChange (ProductID, Change, ChangeDate)SELECT ProductID, inPrice - delPrice, SYSDATETIME()FROM ( UPDATE dbo.Products SET Price *= 1.1 OUTPUT inserted.ProductID, inserted.Price, deleted.Price WHERE PriceIncrease = 1) p (ProductID, inPrice, delPrice); You need to predict the results of the query. Which results should the query produce? A. Five rows are updated in dbo.Products.No rows are inserted into dbo.PriceChange. B. No rows are updated in dbo.Products.Five rows are inserted into dbo.PriceChange. C. No rows are updated in dbo.Products.No rows are inserted into dbo.PriceChange. D. Five rows are updated in dbo.Products.Five rows are inserted into dbo.PriceChange.
Answer: D Question: 26
You are tasked to create a table that has a column that must store the current time accurate to Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
20 2
Answer: B Question: 27
You are a developer of a Microsoft SQL Server 2008 R2 database instance that supports a web-based order-entry application. You need to create a server-side trace that meets the following requirements: Captures performance information from 05:00 hours to 05:30 hours daily. Stores trace information in a format that can be used even while users are disconnected from the network. Which four actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.) A. Create a server-side trace by using the SQL Server Profiler tool. Configure the trace to start at 05:00 hours and to stop at 05:30 hours. B. Save the trace information to a SQL table. C. Save the trace information to a trace file. D. Export the trace file to a SQL script. E. Create a server-side trace by using the SQL Server Profiler tool. Configure the trace to stop at 05:30 hours. F. Create a SQL Server Agent job by using the exported SQL script. Schedule the job to start at 05:00 hours daily.
Answer: (E BEFORE C) AND (C BEFORE D) AND (D BEFORE F) AND ONLY (E, C, D, F) Question: 28
You administer a Microsoft SQL Server 2008 database that contains a table named Sales.SalesOrderHeader. The Sales.SalesOrderHeader table has the following definition: CREATE TABLE [Sales].[SalesOrderHeader]( [SalesOrderID] [int] IDENTITY(1,1) NOT NULL, [OrderDate] [datetime] NOT NULL, [DueDate] [datetime] NOT NULL, [ShipDate] [datetime] NULL, [Status] [tinyint] NOT NULL, [CustomerID] [int] NOT NULL, [SalesPersonID] [int] NULL, [SubTotal] [money] NOT NULL, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
21 2
22 2
Answer: F Question: 30
You administer a Microsoft SQL Server 2008 R2 database instance named AdventureWorks. A user who has the db_datareader permissions on the AdventureWorks database wants to view detailed information about how the following query will be executed: SELECT * FROM Sales.SalesOrderHeaderWHERE OnlineOrderFlag = 1 AND SubTotal > 500 You need to ensure that the user can view the following information in a data grid without executing Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
23 2
Answer: B Question: 32
You are given a database design to evaluate. All of the tables in this database should have a clustered index. You need to determine the tables that are missing a clustered index by using the system catalog views. Which Transact-SQL statement should you use? A. SELECT name AS table_nameFROM sys.tablesWHERE OBJECTPROPERTY(object_id,'TableHasClustIndex') = 0ORDER BY name; B. SELECT name AS table_nameFROM sys.tablesWHERE OBJECTPROPERTY(object_id,'TableHasClustIndex') = 0 AND OBJECTPROPERTY(object_id,'TableHasUniqueCnst') = 1ORDER BY name; C. SELECT name AS table_nameFROM sys.tablesWHERE OBJECTPROPERTY(object_id,'TableHasUniqueCnst') = 0ORDER BY name; D. SELECT name AS table_nameFROM sys.tablesWHERE Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
24 2
Answer: A Question: 33
You work for an international charity organization. You are writing a query to list the highest 100 different amounts that were donated. You have written the following code segment: 01 SELECT *02 FROM (SELECT Customer.CustomerID, SUM(TotalDue) AS TotalGiven, 03 04 FROM Customer05 JOIN SalesOrder 06 ON Customer.CustomerID = SalesOrder.CustomerID07 GROUP BY Customer.CustomerID) AS DonationsToFilter08 WHERE FilterCriteria <= 100 You need to insert a Transact-SQL clause in line 03 to complete the query. Which Transact-SQL clause should you insert? A. NTILE(100) OVER (ORDER BY SUM(TotalDue) DESC) AS FilterCriteria B. DENSE_RANK() OVER (ORDER BY SUM(TotalDue) DESC) AS FilterCriteria C. ROW_NUMBER() OVER (ORDER BY SUM(TotalDue) DESC) AS FilterCriteria D. RANK() OVER (ORDER BY SUM(TotalDue) DESC) AS FilterCriteria
Answer: B Question: 34
You are a database developer for your organization. You have an application hosted on Microsoft SQL Server 2008 R2. One of the tables in the application database has the following definition: CREATE TABLE XMLData(XMLPage xml NOT NULL) No indexes, keys, or constraints are defined along with the table. The table currently contains more than one million entries. An example of the XML data is shown below: Company <Employee Name = "Mark" = "Department Finance"/> <Employee Name = "Peter" = "Department Sales"/> <Employee Name = "Susan" = "Department Facilities"/>Company A stored procedure is executed in the application. The stored procedure has the following definition: CREATE PROCEDURE p_GetFinanceUser(@Name varchar(20))AS SELECT Name = Company.Employee.value('@Name','varchar(20)') ,Department = Company.Employee.value('@Department','varchar(20)')FROM XMLData cCROSS APPLY XMLPage.nodes('/Company/Employee') Department(Employee)WHERE Company.Employee.exist('@Department[.="Finance"]') = 1 Users report that the response time of the stored procedure has decreased. You need to ensure that the response time of the stored procedure is improved. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. CREATE INDEX idx_XMLPage ON XMLData (XMLPage) Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
25 2
Answer: D Question: 36
You administer a Microsoft SQL Server 2008 database that includes a table named ProductDetails. The Products table has the following schema: CREATE TABLE dbo.ProductDetails( ProductID nchar(4) NOT NULL, ProductName nvarchar(50) NULL, ProductDescription nvarchar(50) NULL, UnitCost money NULL, UnitPrice money NULL, ReOrderLevel int NOT NULL, CONSTRAINT PK_ProductDetails PRIMARY KEY CLUSTERED ( ProductID ASC )) GO You create a User-Defined Function (UDF) in the same database. The UDF has the following schema: CREATE FUNCTION dbo.CalculateProductProfit(@ProductID nchar(4))RETURNS MoneyWITH SCHEMABINDINGASBEGIN DECLARE @Profit Money; SELECT @Profit = UnitPrice - UnitCost FROM dbo.ProductDetails WHERE ProductID = @ProductID; RETURN @Profit;END You need to meet the following requirements: Ensure that the UnitPrice column in the ProductDetails table does not accept NULL values. Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
26 2
Answer: A Question: 38
Your company manufactures and distributes bowling balls. You have a full-text catalog named ftCatalog which contains the ftInventory index on the Products table. Your marketing department has just inserted a new bowling ball into the Inventory table. You notice only the new bowling ball is not being included in the results of the full-text searches. You have confirmed that the row exists in the Products table. You need to update the full-text catalog in the least amount of time. Which Transact-SQL statement should you use? Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
27 2
Answer: C Question: 39
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance used to support a customer service application. You create tables named complaint, customer, and product as follows: CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate] [datetime]); CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), [State] [varchar](50), [ZipCode] [varchar](5)); CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), [SalePrice] [money], [ManufacturerName] [varchar](100)); You need to write a query to sum the monthly sales of each product. Which SQL query should you use? A. SELECTp.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID GROUP BY p.ProductName, ComplaintMonth; B. SELECTc.CustomerName,p.ProductName,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDGROUP BY GROUPING SETS ((c.CustomerName), (p.ProductName), ()); C. SELECTp.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID GROUP BY p.ProductName, DATEPART(mm, com.ComplaintDate); D. SELECTc.CustomerName,AVG(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDWHEREcom.ComplaintDate > '09/01/2011'GROUP BYc.CustomerNameHAVINGAVG(p.SalePrice) >= 500 E. SELECTp.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID GROUP BY CUBE(p.ProductName, DATEPART(mm, com.ComplaintDate)); F. SELECTc.CustomerName,COUNT(com.ComplaintID) AS complaintsFROMcustomer c INNER JOINcomplaint com ON c.CustomerID = com.CustomerIDGROUP BYc.CustomerNameHAVINGCOUNT(com.ComplaintID) > 10; Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
28 2
Answer: A Question: 40
You have the following two tables. ProductsProductID ProductName VendorID1 Product1 02 Product2 13 Product3 14 Product4 0 ProductChangesProductID ProductName VendorID1 Product1 12 Product2 13 NewProduct3 25 Product5 1 You execute the following statement. MERGE Products USING ProductChanges ON (Products.ProductID = ProductChanges.ProductID)WHEN MATCHED AND Products.VendorID = 0 THEN DELETEWHEN MATCHED THEN UPDATE SET Products.ProductName = ProductChanges.ProductName, Products.VendorID = ProductChanges.VendorID; You need to identify the rows that will be displayed in the Products table. Which rows will be displayed? A. ProductID ProductName VendorID1 Product1 12 Product2 13 NewProduct3 24 Product4 05 Product5 1 B. ProductID ProductName VendorID1 Product1 12 Product2 13 NewProduct3 25 Product5 1 C. ProductID ProductName VendorID2 Product2 13 NewProduct3 24 Product4 0 D. ProductID ProductName VendorID2 Product2 13 NewProduct3 2
Answer: C Question: 41
You have a database that contains two tables named ProductCategory and ProductSubCategory. You need to write a query that returns a list of product categories that contain more than ten Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
29 2
Answer: D Question: 42
You are a developer of a Microsoft SQL Server 2008 R2 database instance that supports a web-based order-entry application. You need to create a server-side trace that meets the following requirements: Captures performance information from 07:00 hours to 07:30 hours daily. Stores trace information in a portable format. Which four actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.) A. Create a server-side trace by using the SQL Server Profiler tool. Configure the trace to start at 07:00 hours and to stop at 07:30 hours. B. Save the trace information to a SQL table. C. Save the trace information to a trace file. D. Export the trace file to a SQL script. E. Create a server-side trace by using the SQL Server Profiler tool. Configure the trace to stop at 07:30 hours. F. Create a SQL Server Agent job by using the exported SQL script. Schedule the job to start at 07:00 hours daily.
Answer: (E BEFORE C) AND (C BEFORE D) AND (D BEFORE F) AND ONLY (E, C, D, F) Question: 43
You have two views named Sales.SalesSummaryOverall and Sales.CustomerAndSalesSummary. They are defined as follows: CREATE VIEW Sales.SalesSummaryOverallAS SELECT CustomerId, SUM(SalesTotal) AS OverallTotal FROM Sales.SalesOrder GROUP BY CustomerIdGOCREATE VIEW Sales.CustomerAndSalesSummaryAS SELECT Customer.Name, SalesSummaryOverall.OverallTotal, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
30 3
Answer: B Question: 44
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database for an inventory management system. The application contains a product table that has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, [Style] [nchar](2) NULL, [Active] [bit] NOT NULL, [ModifiedDate] [datetime] NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ( [ProductID] ASC ) ON [PRIMARY]) ON [PRIMARY]GO You want to add a new field to the Product table to meet the following requirements: Allows user-specified information that will be added to records in the Product table. Supports the largest storage size needed for the field. Uses the smallest data type necessary to support the domain of values that will be entered by users. You need to add a field named User_Data_1 to support U.S. dollar currency values that Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
31 3
Answer: Q Question: 45
You administer a Microsoft SQL Server 2008 database that contains a table named Sales.SalesOrderDetail and a view named Sales.ProductOrders. The view has the following definition: CREATE VIEW Sales.ProductOrders AS SELECT ProductID, COUNT(*) as NbrOfOrders, SUM(OrderQty) as TotalOrderQtyFROM Sales.SalesOrderDetailGROUP BY ProductIdGO The Sales.SalesOrderDetail table contains 5 million rows. Report queries that join to this view consume excessive disk I/O. You need to create an index on the view. Which Transact-SQL statement or statements should you use? A. ALTER VIEW Sales.ProductOrders WITH SCHEMABINDING ASSELECTProductID,COUNT(*) as NbrOfOrders,SUM(OrderQty) as TotalOrderQtyFROMSales.SalesOrderDetailGROUP BYProductIdGOCREATE UNIQUE CLUSTERED INDEX IX_V_ProductOrders ON Sales.ProductOrders (ProductID)GO B. ALTER VIEW Sales.ProductOrders WITH SCHEMABINDING ASSELECTProductID,COUNT_BIG(*) as NbrOfOrders,SUM(OrderQty) as TotalOrderQtyFROMSales.SalesOrderDetail WITH (NOLOCK)GROUP BYProductIdGOCREATE UNIQUE CLUSTERED INDEX IX_V_ProductOrders ON Sales.ProductOrders (ProductID)GO C. ALTER VIEW Sales.ProductOrders WITH SCHEMABINDING ASSELECTProductID,COUNT_BIG(*) as NbrOfOrders,SUM(OrderQty) as TotalOrderQtyFROMSales.SalesOrderDetailGROUP BYProductIdGOCREATE UNIQUE CLUSTERED INDEX IX_V_ProductOrders ON Sales.ProductOrders Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
32 3
Answer: C OR E Question: 46
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database for an inventory management system. The application contains a product table that has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, [Style] [nchar](2) NULL, [Active] [bit] NOT NULL, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
33 3
Answer: O Question: 47
34 3
You are developing a database using Microsoft SQL Server 2008. The database contains the tables shown in the following exhibit. (Click the Exhibit button.) 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 should 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? A. CREATE TRIGGER tr_Part_d ON PartINSTEAD OF DELETE AS BEGIN END B. CREATE TRIGGER tr_Part_d ON PartAFTER DELETE AS BEGIN END Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
35 3
Answer: A Question: 48
You are using TRYCATCH error handling. You need to raise an error that will pass control to the CATCH block. Which severity level should you use? A. 10 B. 16 C. 9 D. 0
Answer: B Question: 49
You need to alter stored procedures to use the WITH RECOMPILE option. Which types of stored procedures should you alter? (Each correct answer represents a complete solution. Choose two.) A. Stored procedures implemented from CLR assemblies. B. Stored procedures that require the FOR REPLICATION option. C. Stored procedures that require the WITH ENCRYPTION option. D. Stored procedures that contain queries that use the OPTION (RECOMPILE) hint.
Answer: C AND D
Question: 50
Your company uses an application that passes XML to the database server by using stored procedures. The database server has a large number of XML handles that are currently active. You determine that the XML is not being flushed from SQL Server memory. You need to identify the system stored procedure to flush the XML from memory. Which Transact-SQL statement should you use? A. sp_xml_preparedocument B. sp_xml_removedocument C. DBCC DROPCLEANBUFFERS D. DBCC FREEPROCACHE
Answer: B Question: 51
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance. You create tables named order, customer, and product as follows: CREATE TABLE [dbo].[order] ([OrderID] [int], [ProductID] [int], Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
36 3
Answer: I Question: 52
Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
37 3
Answer: B Question: 53
You need to build CREATE INDEX statements for all the missing indexes that SQL Server has identified. Which dynamic management view should you use? A. sys.dm_db_missing_index_columns B. sys.dm_db_index_usage_stats C. sys.dm_db_missing_index_group_stats D. sys.dm_db_missing_index_details
Answer: D Question: 54
You need to write a query that uses a ranking function that returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition. Which Transact-SQL statement should you use? A. ROW_NUMBER B. DENSE_RANK C. RANK D. NTILE(10)
Answer: A Question: 55
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance. You create tables named order, customer, and product as follows: CREATE TABLE [dbo].[order] ([OrderID] [int], [ProductID] [int], [CustomerID] [int], [OrderDate] [datetime]); CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), [State] [varchar](50), [ZipCode] [varchar](5)); CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
38 3
Answer: C Question: 56
39 3
You administer a Microsoft SQL Server 2008R2 database that hosts a customer relationship management (CRM) application. The application supports the following two types of customers as shown in the exhibit. (Click the Exhibit button.) Business customers who have shipments sent to their office locations Residential customers who have shipments sent to their home address You need to generate a list of residential customers who live in North America. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. DECLARE @CustomerListHomeAddress TABLE (CustomerId INT NOT NULL)INSERT INTO@CustomerListHomeAddressSELECTCustomerIDFROMSales.CustomerAddressWHEREAddres Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
40 4
41 4
Answer: A OR H Question: 58
You are the database developer for an order-processing application. After a customer places an order, a confirmation message must be sent to the customer. The following Transact-SQL batch has been run in the database: ALTER DATABASE NORTHWIND SET ENABLE_BROKER; CREATE MESSAGE TYPE EmailMessageVALIDATION = NONE; CREATE CONTRACT EmailContract(EmailMessage SENT BY INITIATOR); CREATE QUEUE EmailSendQueue; CREATE QUEUE EMailReceiveQueue; CREATE SERVICE EmailSendServiceON QUEUE EmailSendQueue (EmailContract); CREATE SERVICE EmailReceiveServiceON QUEUE EmailReceiveQueue (EmailContract); You need to place the message in the EmailSendQueue for the email system to process. Which Transact-SQL batch should you use? A. DECLARE@EmailDialog UNIQUEIDENTIFIER,@Message NVARCHAR(128);BEGIN DIALOG Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
42 4
Answer: A OR D Question: 59
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? A. SELECT* FROMSales.PotentialClientsWHEREEmailAddress LIKE'_%@_.com' B. SELECT * FROM Sales.PotentialClientsWHERE EmailAddress LIKE '_%@_%.com' Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
43 4
Answer: B Question: 60
Your server collation is SQL_Latin1_General_CP1_CI_AS. You have a database named Contoso that has a collation setting of SQL_Scandinavian_Cp850_CI_AS. You create and populate a temporary table #Person from table dbo.Person in Contoso using the following statements: USE Contoso;CREATE TABLE #Person (LastName nchar(128));INSERT INTO #Person SELECT LastName FROM dbo.Person;You then run the following command: SELECT * FROM dbo.Person a JOIN #Person b ON a.LastName = b.LastName; This command returns the following error: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "SQL_Scandinavian_Cp850_CI_AS" in the equal to operation. You need to resolve the collation conflict. Which Transact-SQL statement should you use? A. CREATE TABLE #Person (LastName nvarchar(128) COLLATE database_default); B. CREATE TABLE #Person (LastName nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS); C. CREATE TABLE #Person (LastName nvarchar(128) SPARSE); D. CREATE TABLE tmpPerson (LastName nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS);
Answer: A Question: 61
You have a server named Contoso with multiple databases. You have been tasked to write a PowerShell script to determine which databases on the server are larger than 100GB. You open PowerShell from SQL Server Management Studio. You create two variables as follows: PS SQLSERVER:\SQL\Contoso> $MultipleOfGB = 1024 * 1024 PS SQLSERVER:\SQL\Contoso> $Server = Get-Item You need to determine which script will produce the desired list of databases. What script should you use? A. $Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -match 100GB\} | Select-Object Name, DatabaseSize B. $Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -gt 100GB\} | Select-Object Name, Size C. $Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -match 100GB\} | Select-Object Name, Size D. $Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -gt 100GB\} | Select-Object Name, DatabaseSize
Answer: B Question: 62
You are updating a database table. You need to partition the table to store only the last 1000 rows of data in the table. What should you do? Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
44 4
Answer: B Question: 63
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You administer a Microsoft SQL Server 2008 database named AdventureWorks that contains a table named Production.Product. The table contains a primary key named PK_Product_ProductID and a non-clustered index named AK_Product_ProductNumber. Both indexes have been created on a single primary partition. The table has the following definition: CREATE TABLE [Production].[Product]( [ProductID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [ProductNumber] [nvarchar](25) NOT NULL, [Color] [nvarchar](15) NULL, [Class] [nchar](2) NULL, [Style] [nchar](2) NULL, [ModifiedDate] [datetime] NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ( [ProductID] ASC ) ON [PRIMARY]) ON [PRIMARY]GO The index has the following definition: CREATE UNIQUE NONCLUSTERED INDEX [AK_Product_ProductNumber] ON [Production].[Product] ( [ProductNumber] ASC) ON [PRIMARY]GO The Production.Product table contains 1 million rows. You want to ensure that data retrieval takes the minimum amount of time when the queries executed against the Production.Product table are ordered by product number or filtered by class. You need to refresh statistics on the Production.Product table. Which Transact-SQL statement should you use? A. ALTER INDEX AK_Product_ProductNumber ON Production.Product REORGANIZE B. SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID(N'Production.Product'),NULL, NULL, NULL) C. ALTER DATABASE [AdventureWorks] SET AUTO_UPDATE_STATISTICS ON D. UPDATE INDEX AK_Product_ProductNumber ON Production.Product SET (STATISTICS_NORECOMPUTE = ON) E. ALTER INDEX AK_Product_ProductNumber ON Production.Product REBUILD Partition = 1 F. SELECT * FROM sys.dm_db_index_operational_stats (DB_ID(), OBJECT_ID(N'Production.Product'),NULL, NULL) G. SELECT * FROM sys.indexes where name=N'Production.Product' H. CREATE STATISTICS ProductClass_StatsON Production.Product (Name, ProductNumber, Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
45 4
Answer: L Question: 64
You have two tables named dbo.CurrentProducts and dbo.ArchiveProducts. You have the following query: SELECT ProductID, Name FROM dbo.CurrentProductsUNION ALLSELECT ProductID, NameFROM dbo.ArchiveProducts; You need to predict the list of products that the query will produce. Which list of products should the query return? A. Products that appear in dbo.CurrentProducts or dbo.ArchiveProducts but not in both. B. Products that appear in dbo.CurrentProducts or dbo.ArchiveProducts. Products that appear in both tables are listed multiple times. C. Products that have a matching ProductID and Name in dbo.CurrentProducts or dbo.ArchiveProducts. D. Products that appear in dbo.CurrentProducts or dbo.ArchiveProducts. Products that appear in both tables are listed only once.
Answer: B Question: 65
You need to identify which products will be inserted when you execute the following code block. BEGIN TRANSACTION INSERT INTO Product (ProductName) VALUES ('food') BEGIN TRANSACTION INSERT INTO Product (ProductName)) VALUES ('beverage') COMMIT TRANSACTIONROLLBACK TRANSACTION Which products will be inserted? A. None B. Beverage C. Food and beverage D. Food
Answer: A Question: 66
Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
46 4
Answer: C OR G
47 4
Question: 67
You are the database administrator for an order management system. The database has the following two schemas: The dbo schema that is used by the main data processing group A Reporting schema that is used by the reporting group The application contains a product table that has the following definition: CREATE TABLE dbo.Product( ProductID INT, ProductName VARCHAR(100), SalePrice MONEY, ManufacturerName VARCHAR(150)); The application contains an order table that has the following definition: CREATE TABLE dbo.[Order]( OrderID INT, ProductID INT, CustomerID INT, OrderDate DATETIME2); The application also contains a customer table that has the following definition: CREATE TABLE dbo.Customer (CustomerID INT, CustomerName VARCHAR(100), [Address] VARCHAR(200), City VARCHAR(100), [State] VARCHAR(50), ZipCode VARCHAR(5)); You want to load a subset of data from the product and order tables in the dbo schema to a new ProductOrderHistory table in the Reporting schema. You need to ensure that the table meets the following requirements: Includes rows for every product that has been manufactured by "Contoso". Includes rows for every product that was ordered from March 1, 2011 to May 31, 2011. The Reporting.ProductOrderHistory columns have the following types: CustomerName VARCHAR(100)ProductName VARCHAR(100)SalePrice MONEYManufacturerName VARCHAR(150)ProductOrderDate DATETIME Which Transact-SQL query should you use? A. SELECTc.CustomerName,p.ProductName,p.SalePrice,p.ManufacturerName,CAST(o.OrderDate as datetime) as ProductOrderDateINTO Reporting.ProductOrderHistoryFROMdbo.product p LEFT JOIN(dbo.[order] o INNER JOINdbo.customer c ON o.CustomerID = c.CustomerID) ON p.ProductID = o.ProductID WHEREp.ManufacturerName = 'Contoso' OR(o.OrderDate >= '20110301' ANDo.OrderDate < '20110601') B. SELECTc.CustomerName,p.ProductName,p.SalePrice,p.ManufacturerName,o.OrderDate as ProductOrderDateINTO Reporting.ProductOrderHistoryFROMdbo.product p INNER JOINdbo.[order] o ON p.ProductID = o.ProductID INNER JOINdbo.customer c ON o.CustomerID = c.CustomerID WHEREp.ManufacturerName = '%Contoso%' OR(o.OrderDate >= '20110301'AND o.OrderDate < '20110601') C. SELECTc.CustomerName,p.ProductName,p.SalePrice,p.ManufacturerName,CAST(o.OrderDate as datetime) as ProductOrderDateINTO Reporting.ProductOrderHistoryFROMdbo.Product p LEFT JOIN(dbo.[Order] o INNER JOINdbo.Customer c ON o.CustomerID = c.CustomerID) ON p.ProductID = o.ProductID WHEREp.ManufacturerName = 'Contoso' ORo.OrderDate BETWEEN '20110301' AND '20110531'; Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
48 4
Answer: A OR D Question: 68
You have tables named Sales.SalesOrderDetails and Sales.SalesOrderHeader. You have been tasked to update the discount amounts for the sales of a particular salesperson. You need to set UnitPriceDiscount to .1 for all entries in Sales.SalesOrderDetail that only correspond to SalesPersonID 290. Which Transact-SQL statement should you use? A. UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount = .1WHERE EXISTS (SELECT * FROM Sales.SalesOrderHeader hWHERE h.SalesPersonID = 290); B. UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount = .1FROM Sales.SalesOrderHeader hWHERE h.SalesPersonID = 290; C. UPDATE d SET UnitPriceDiscount = .1FROMSales.SalesOrderDetail dINNER JOINSales.SalesOrderHeader hON h.SalesOrderID = d.SalesOrderIDWHERE h.SalesPersonID = 290; D. UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount = .1FROM Sales.SalesOrderDetail dWHERE EXISTS (SELECT * FROM Sales.SalesOrderHeader hWHERE h.SalesPersonID = 290);
Answer: C
Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
49 4
Question: 69
You have a third-party application that inserts data directly into a table. You add two new columns to the table. These columns cannot accept NULL values and cannot use default constraints. You need to ensure that the new columns do not break the third-party application. What should you do? A. Create an INSTEAD OF INSERT trigger. B. Create a stored procedure. C. Create a DDL trigger. D. Create an AFTER INSERT trigger.
Answer: A Question: 70
You are a developer for a Microsoft SQL Server 2008 R2 database instance that hosts an application. You are designing some new tables. You need to choose the most appropriate data types. Which data types should you use? (To answer, drag the appropriate data type to the correct data in the answer area. Each data type may be used once, more than once, or not at all. Each data may be used once or not at all. Additionally, you may need to drag the split bar between panes or scroll to view content.) 1. XML 2. nvarchar(max) 3. varbinary(max) FILESTREAM 4. datetime2 5. timestamp none.gif DataXML data validated by an XSDDatetimeInternational text data longer than 5,000 charactersXML data that must be indexed and searched by using XPATH queriesXML data that must be preserved exactly as it was receivedMP3 audio filesThe date and time a row was last modifiedHTML fragments
50 5
Answer: C
51 5
Question: 72
You have a database that uses stored procedures to perform INSERT, UPDATE, DELETE, and SELECT statements. You are tasked with providing a recommendation of indexes to be created and dropped from the database. You need to select the appropriate method to accomplish the task. Which method should you use? A. SQL Server Profiler B. Database Engine Tuning Advisor C. Index Usage DMVs D. Missing Index DMVs
Answer: B Question: 73
You have an application that is used by international clients. All clients connect by using Windows Authentication. You need to ensure that system and user-defined error messages are displayed in the localized language for the clients. What should you do? (Each correct answer represents part of the solution. Choose two.) A. Use @@LANGUAGE function B. Use default language for each login C. Use @lang parameter of sp_addmessage D. Use the "set language" option of sp_configure
Which Transact-SQL statements should you use? A. SELECT Name = Company.Employee.query('@Name','varchar(20)'), Department = Company.Employee.query('@Department','varchar(20)')FROM CompanyXML cCROSS APPLY CompanyDoc.nodes('/Company/Employee') Company(Employee) Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
52 5
53 5
Answer: C OR H Question: 75
You have implemented change tracking on a table named Sales.SalesOrder. You need to determine all columns that have changed since the minimum valid version. Which function should you use? A. CHANGETABLE with the VERSION argument B. CHANGETABLE with the CHANGES argument C. CHANGE_TRACKING_CURRENT_VERSION D. CHANGE_TRACKING_IS_COLUMN_IN_MASK
Answer: B Question: 76
You administer a Microsoft SQL Server 2008 database that contains tables named Sales.Customer and Sales.SalesOrder. A diagram of the tables is shown in the exhibit. (Click the Exhibit button.) You need to execute a query to update the value of the CustomerValue field to HV when a customer has more than 5 orders for a total sales amount of more than 5,000 U.S. dollars. Which Transact-SQL statement should you use? A. UPDATE Sales.Customer SETCustomerValue = 'HV'FROMSales.CustomerWHERESalesAmount > 5000AND CustomerID IN(SELECTc.CustomerIDFROMSales.Customer cINNER JOINSales.SalesOrder o ON o.CustomerID=c.CustomerIDGROUP BYc.CustomerIDHAVINGCOUNT(*) > 5) B. UPDATE Sales.Customer SETCustomerValue = 'HV'FROMSales.CustomerWHERECustomerID IN(SELECTc.CustomerIDFROMSales.Customer cINNER JOINSales.SalesOrder o ON o.CustomerID=c.CustomerIDGROUP BYc.CustomerIDHAVINGCOUNT(*) > 5AND SUM(SalesAmount) > 5000) C. UPDATE c SETCustomerValue = 'HV'FROMSales.SalesOrder oINNER JOINSales.Customer c ON c.CustomerID=o.CustomerIDGROUP BYc.CustomerIDHAVINGCOUNT(*) > 5AND SUM(SalesAmount) > 5000 D. UPDATE c SETCustomerValue = 'HV'FROMSales.SalesOrder oINNER JOINSales.Customer c ON c.CustomerID=o.CustomerIDWHERESalesAmount > 5000GROUP BYc.CustomerIDHAVINGCOUNT(*) > 5 E. UPDATE u SETCustomerValue = 'HV'FROMSales.Customer Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
54 5
Answer: B OR E Question: 77
2012 Microsoft Corporation. All rights reserved. WelcomeWelcome to this Microsoft Certification exam. The following information is provided to help you use your exam time most efficiently. Exam Format and Question FormatsThis exam session includes multiple sections. You will see introductory sections, the exam content, and post-exam sections. This exam might contain several question formats. The Instructions button located at the bottom of each question screen provides information on the question format shown. TimingThe amount of time that you have to complete this exam was provided on the Welcome Screen. The amount of time you have remaining in each section is provided in the upper-right corner of each screen. Any delays, such as the loading of the next screen, will not be counted against your exam time. Number of Questions The total number of questions on this exam is provided on the Get Ready to Take the Exam! screen. The number of questions remaining in each section is provided in the upper-left corner of each question. Reviewing/CommentingThe Mark for review or comment check box located in the upper-left corner of each question screen can be used to flag a question that you want to review. At the end of this exam, you will see a screen that shows you which questions you have marked for review. The Mark for review or comment check box can also be used to flag a question for which you want to provide a comment. Note that you cannot make comments during the exam. The comment period is timed separately; any time you spend making comments does not affect the time limit for the exam itself. Important Changes to Your Exam Experience ScrollingYou will no longer be notified that you have not viewed the entire question when you move to another question. In other words, you will not be prompted to scroll to the end of a question before you move to the next one. Keyboard ShortcutsFunctionality, such as keyboard shortcuts, can be used during the exam. Additional information about the keyboard controls that are available within the exam can be found by Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
55 5
Question: 78
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance used to support a customer service application. You create tables named complaint, customer, and product as follows: CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate] [datetime]); CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), [State] [varchar](50), [ZipCode] [varchar](5)); CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), [SalePrice] [money], [ManufacturerName] [varchar](100)); You need to write a query to sum the sales made to each customer who has made a complaint by the following entries: Each customer name Each product name The grand total of all sales Which SQL query should you use? A. SELECTc.CustomerName,p.ProductName,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDGROUP BY GROUPING SETS ((c.CustomerName, p.ProductName), ()); B. SELECTp.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID GROUP BY CUBE(p.ProductName, DATEPART(mm, com.ComplaintDate)); C. SELECTc.CustomerName,AVG(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID INNER JOINcustomer c ON com.CustomerID = c.CustomerIDWHEREcom.ComplaintDate > '09/01/2011' ANDAVG(p.SalePrice) >= 500 D. SELECTp.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS SalesFROMproduct p INNER JOINcomplaint com ON p.ProductID = com.ProductID GROUP BY CUBE; E. SELECTc.CustomerName,COUNT(com.ComplaintID) AS complaintsFROMcustomer c INNER JOINcomplaint com ON c.CustomerID = com.CustomerIDGROUP BYc.CustomerNameHAVINGCOUNT(com.ComplaintID) > 10; Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
56 5
Answer: J Question: 79
You have a table named Employee. You document your company's organizational hierarchy by inserting the EmployeeID of each employee's manager in the ReportsTo column. You need to write a recursive query that produces a list of employees and their manager. The query must also include the employee's level in the hierarchy. You write the following code segment. (Line numbers are included for reference only.) 01 WITH EmployeeList (EmployeeID, FullName, ManagerName, Level)02 AS (03 04 )05 SELECT EmployeeID, FullName, ManagerName, Level06 FROM EmployeeList; Which code segment should you insert at line 3? A. SELECT EmployeeID,FullName,'' AS [Reports To],1 AS [Level]FROM EmployeeUNION ALLSELECT emp.EmployeeID,emp.FullName,mgr.FullName,1 + 1 AS [Level]FROM Employee empLEFT JOIN Employee mgrON emp.ReportsTo = mgr.EmployeeID B. SELECT EmployeeID,FullName,'' AS [ReportsTo],1 AS [Level]FROM EmployeeWHERE ReportsTo IS NULLUNION ALLSELECT emp.EmployeeID,emp.FullName,mgr.FullName,mgr.Level + 1FROM EmployeeList mgrJOIN Employee empON emp.ReportsTo = mgr.EmployeeId C. SELECT EmployeeID,FullName,'' AS [ReportsTo],1 AS [Level]FROM EmployeeUNION ALLSELECT emp.EmployeeID,emp.FullName,mgr.FullName,mgr.Level + 1FROM EmployeeList mgrJOIN Employee empON emp.ReportsTo = mgr.EmployeeID D. SELECT EmployeeID,FullName,'' AS [ReportsTo],1 AS [Level]FROM EmployeeWHERE ReportsTo IS NULLUNION ALLSELECT emp.EmployeeID,emp.FullNName,mgr.FullName,1 + 1 AS [Level]FROM Employee empJOIN Employee mgrON emp.ReportsTo = mgr.EmployeeID
Answer: B Question: 80
You are a developer for a Microsoft SQL Server 2008 R2 database instance. You plan to add Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
57 5
58 5
Answer: B OR F Question: 83
You need to write a query that allows you to rank total sales for each salesperson into four groups, where the top 25 percent of results are in group 1, the next 25 percent are in group 2, the next 25 percent are in group 3, and the lowest 25 percent are in group 4. Which Transact-SQL statement should you use? A. NTILE(100) B. NTILE(25) C. NTILE(4) D. NTILE(1)
Answer: C Question: 84
You administer a Microsoft SQL Server 2008 database that includes a table named Products. The Products table has the following schema: CREATE TABLE dbo.Products( Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
59 5
60 6
Answer: B Question: 86
You want to delete a User-Defined Function (UDF) named ufnGetProductListPrice from the AdventureWorks2008R2 database. You need to perform the following tasks before executing DROP FUNCTION on ufnGetProductListPrice: View a list of objects that depend on ufnGetProductListPrice. View a list of objects on which ufnGetProductListPrice depends. What should you do? (To answer, select the appropriate option or options in the answer area.)
Work Area
Answer: D Question: 87
You are a database developer for your organization. You create an application that uses a Transact-SQL variable to store user input data. The database collation is case-insensitive. The variable is constructed as shown in the following statement: DECLARE @content varchar(64) SELECT @content = 'The Advanced Research Projects Agency Network (ARPANET), was the worlds first operational packet switching network and the core network of a set that came to compose the global Internet.' You need to implement a keyword search that meets the following requirements: Searches for the existence of the word ARPANET within the user-entered content. If the search term is found, the statement must return its starting position, and 0 otherwise. Performs a case-sensitive search for the given search term. Which Transact-SQL statement should you use? Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
61 6
Answer: B OR F Question: 88
You create a database named AdventureWorks. You want to create a new table to store customer reviews for all products within the database. The table must meet the following requirements: Stores information for the Product ID, Customer ID, Rating, and Reviews columns. The Reviews column can contain NULL values. The Reviews column is optimized to store NULL values. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. USE AdventureWorksGO B. ALTER TABLE ProductReviewsALTER COLUMN Review NOT NULL ADD SPARSE;GO C. ALTER TABLE ProductReviewsALTER COLUMN Review ADD SPARSE ;GO D. CREATE TABLE ProductReviews(CustomerID nchar(6) NOT NULL,ProductID nchar(6) NOT NULL,Rating smallint NOT NULL,Review varchar(500) NOT NULL,CONSTRAINT PK_ProductReviews PRIMARY KEY CLUSTERED(CustomerID ASC,ProductID ASC))GO E. CREATE TABLE ProductReviews(CustomerID nchar(6) NOT NULL,ProductID nchar(6) NOT NULL,Rating smallint NULL,Review varchar(500) NULL,CONSTRAINT PK_ProductReviews PRIMARY KEY CLUSTERED(CustomerID ASC,ProductID ASC))GO F. CREATE TABLE ProductReviews(CustomerID nchar(6) NOT NULL,ProductID nchar(6) NOT NULL,Rating smallint NOT NULL,Review varchar(500) SPARSE NOT NULL,CONSTRAINT PK_ProductReviews PRIMARY KEY CLUSTERED(CustomerID ASC,ProductID ASC))GO
62 6
Answer: A Question: 90
You have a table named Orders. OrderID is defined as an IDENTITY(1,1). OrderDate has a default value of 1. You need to write a query to insert a new order into the Orders table for CustomerID 45 with today's date and a cost of 89.00. Which statement should you use? A. INSERT INTO Orders(OrderID, CustomerId, OrderDate, Cost)VALUES (1, 45, DEFAULT, 89.00); B. INSERT INTO Orders(OrderID, CustomerId, OrderDate, Cost)VALUES (1, 45, CURRENT_TIMESTAMP, 89.00); C. INSERT INTO Orders(CustomerId, OrderDate, Cost)VALUES (45, CURRENT_TIMESTAMP, 89.00); D. INSERT INTO Orders(CustomerId, OrderDate, Cost)VALUES (45, DEFAULT, 89.00);
Answer: C Question: 91
A table named Shirts includes an XML column named SizeAndColors that contains the sizes and colors of each shirt, as shown in the following code segment. <shirt size="XS" colors="Red" /><shirt size="S" colors="Red, Blue" />...<shirt size="XL" colors="Blue, Green" /> You need to return a list of shirt colors available in a specific size. Which code segment should you use? A. DECLARE @Size VARCHAR(10) = 'L' SELECT ShirtStyleName,SizeAndColors.value('/shirt[1]/@colors','color')FROM ShirtsWHERE SizeAndColors.exist('/shirt[@size=sql:variable("@Size")]') = 1 B. DECLARE @Size VARCHAR(10) = 'L' SELECT ShirtStyleName,SizeAndColors.query('data(/shirt[@size=sql:variable("@Size")]/@colors)')FROM Shirts C. DECLARE @Size VARCHAR(10) = 'L' SELECT ShirtStyleName,SizeAndColors.value('/shirt[1][@ size =sql:variable("@Size")]/@ colors, 'color')FROM Shirts D. DECLARE @Size VARCHAR(10) = 'L' SELECT ShirtStyleName,SizeAndColors.value('/shirt[1]/@colors','color')FROM ShirtsWHERE SizeAndColors.value('/shirt[1]/@size','varchar(20)') = @Size
Answer: B Question: 92
You have the following XML document that contains Product information. DECLARE @prodList xml ='<ProductList xmlns="urn:Wide_World_Importers/schemas/Products"> <Product Name="Product1" Category="Food" Price="12.3" /> <Product Name="Product2" Category="Drink" Price="1.2" /> <Product Name="Product3" Category="Food" Price="5.1" /> ...</ProductList>'; You need to return a list of products that contains the Product Name, Category, and Price of each product. Which query should you use? A. SELECT prod.value('.[1]/@Name','varchar(100)'),prod.value('.[1]/@Category','varchar(20)'),prod.value('.[ 1]/@Price','money')FROM @prodList.nodes('/ProductList/Product') ProdList(prod); Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
63 6
Answer: C Question: 93
You need to capture and record a workload for analysis by the Database Engine Tuning Advisor (DTA). Which tool should you use? A. Performance Monitor B. SQL Server Profiler C. DTA utility D. Activity Monitor
Answer: B Question: 94
You have a table named Subscribers. You receive an updated list of subscribers. You need to remove subscribers that are no longer on the list. Which clause should you use to remove the subscribers from the table? A. WHEN NOT MATCHED BY TARGET B. WHEN MATCHED C. WHEN NOT MATCHED BY SOURCE D. WHEN NOT MATCHED
Answer: C Question: 95
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series. You are a developer for a Microsoft SQL Server 2008 R2 database instance used to support a customer service application. You create tables named complaint, customer, and product as follows: CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate] [datetime]); CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
64 6
Answer: I
65 6
Question: 96
Your company's database contains Customers and Orders tables. You have been tasked to write a SELECT statement that outputs customer and order data as a valid and well-formed XML document. You are required to mix attribute and element based XML within the document. You have determined that using the FOR XML AUTO clause will not be suitable. You need to identify the correct FOR XML clause to meet the requirement. Which FOR XML statement should you use? (Each correct answer represents a complete solution. Choose two.) A. FOR BROWSE B. FOR XML RAW C. FOR XML PATH D. FOR XML EXPLICIT
Answer: C AND D
Question: 97
You have two tables named Customer and SalesOrder. You need to identify all customers that have not yet made any purchases and those that have only made orders with an OrderTotal less than 100. Which query should you use? A. SELECT *FROM CustomerWHERE 100 > SOME (SELECT OrderTotalFROM SalesOrderWHERE Customer.CustomerID = SalesOrder.CustomerID) B. SELECT *FROM CustomerWHERE EXISTS (SELECT SalesOrder.CustomerIDFROM SalesOrderWHERE Customer.CustomerID = SalesOrder.CustomerIDAND SalesOrder.OrderTotal <= 100) C. SELECT *FROM CustomerWHERE 100 > ALL (SELECT OrderTotalFROM SalesOrderWHERE Customer.CustomerID = SalesOrder.CustomerID) D. SELECT *FROM CustomerWHERE 100 > (SELECT MAX(OrderTotal)FROM SalesOrderWHERE Customer.CustomerID = SalesOrder.CustomerID)
Answer: C Question: 98
66 6
You administer a Microsoft SQL Server 2008R2 database that hosts a customer relationship management (CRM) application. The application supports the following two types of customers as shown in the exhibit. (Click the Exhibit button.) Business customers who have shipments sent to their office locations Residential customers who have shipments sent to their home address You need to generate a list of residential customers who live outside North America. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.) A. DECLARE @CustomerListHomeAddress TABLE (CustomerId INT NOT NULL)INSERT INTO@CustomerListHomeAddressSELECTCustomerIDFROMSales.CustomerAddressWHEREAddres Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
67 6
68 6
69 6
70 7
71 7
72 7
73 7
74 7
You administer a Microsoft SQL Server 2008 database that contains a table named dbo.SalesOrders. The table has the following definition: CREATE TABLE [dbo].[SalesOrder]( [SalesOrderNumber] NVARCHAR(20) NOT NULL, [FullDateAlternateKey] DATETIME NOT NULL, [CustomerName] NVARCHAR(100) NOT NULL, [AddressLine] NVARCHAR(120) NOT NULL, [City] NVARCHAR(30) NOT NULL, [StateProvinceName] NVARCHAR(50) NOT NULL, [CountryName] NVARCHAR(50) NOT NULL, [SalesAmount] MONEY NOT NULL, CONSTRAINT [PK_SalesOrderNumber] PRIMARY KEY CLUSTERED ( [SalesOrderNumber] ASC) ON [PRIMARY]) ON [PRIMARY]GO The SalesOrder table contains one million rows. You want to create a report that meets the following requirements: Only the states of the Unites States are ranked against each other based on the total number of orders received from each state. When two states have the same rank, the rank of the subsequent state is one plus the number of ranks that come before that row, as shown in the exhibit. (Click the Exhibit button.) You need to Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
75 7
76 7
Work Area
77 7
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 as shown in the following the exhibit. (Click the Exhibit button.) You need to write the OPENXML query. Which Transact-SQL statement should you use? A. SELECT ParentSiteURL, SiteURLFROM OPENXML (@XMLDocHandle, '//@URL', 1)WITH (ParentSiteURL nVarChar(512) '../URL',SiteURL nVarChar(512) 'URL') B. SELECT ParentSiteURL, SiteURLFROM OPENXML (@XMLDocHandle, '//URL', 1)WITH (ParentSiteURL nVarChar(512) '../@URL',SiteURL nVarChar(512) '@URL') C. SELECT ParentSiteURL, SiteURLFROM OPENXML (@XMLDocHandle, '//@Site', 1)WITH (ParentSiteURL nVarChar(512) '../URL',SiteURL nVarChar(512) 'URL') D. SELECT ParentSiteURL, SiteURLFROM OPENXML (@XMLDocHandle, '//Site', 1)WITH (ParentSiteURL nVarChar(512) '../@URL',SiteURL nVarChar(512) '@URL')
78 7
79 7
80 8
81 8
82 8
83 8
84 8
85 8
86 8
87 8
88 8
MovieDescription This movie is yet to be released You need to ensure that the following requirements are met: Only this movie record gets a Rating of 0. Other movie records that will be inserted in the future must get a Rating of 1 through 7. Which three Transact-SQL statements should you use? (To answer, move the appropriate statements Complete collection of 70-433 Exam's Question and Answers. http://www.exam1pass.com
89 8
90 9
91 9
92 9
93 9
94 9
95 9
96 9
97 9
Answer: A
98 9