Which Transact-SQL statement should you use?

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 build new query optimization statistics on the Production.Product table to support queries that filter data rows where the class field has a null value.
Which Transact-SQL statement should you use?
A. DBCC SHOW_STATISTICS (‘Production.Product’, AK_Product_ProductNumber)
B. EXEC sys.sp_configure ‘index create memory’, 1
C. ALTER INDEX AK_Product_ProductNumber ON Production.Product REORGANIZE
D. ALTER INDEX AK_Product_ProductNumber ON Production.Product REBUILD Partition = 1
E. CREATE STATS ProductClass_Stats ON Production.Product (Name, ProductNumber, Class) WHERE Class is not null WITH SAMPLE 100 PERCENT
F. SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID(N’Production.Product’),NULL, NULL, NULL)
G. UPDATE INDEX AK_Product_ProductNumber ON Production.Product SET (STATISTICS_NORECOMPUTE = ON)
H. UPDATE STATISTICS Production.Product
I. CREATE STATISTICS ProductClass_Stats ON Production.Product (Name, ProductNumber, Class) WHERE Class <> null
J. SELECT * FROM sys.dm_db_index_operational_stats (DB_ID(), OBJECT_ID(N’Production.Product’),NULL, NULL)
K. SELECT * FROM SYS.STATS WHERE name=’AK_Product_ProductNumber’
L. ALTER INDEX AK_Product_ProductNumber ON Production.Product REBUILD
M. ALTER STATISTICS Production.Product
N. CREATE STATISTICS ProductClass_Stats ON Production.Product (Name, ProductNumber, Class) WHERE Class is not null
O. SELECT * FROM sys.indexes where name=N’Production.Product’
P. ALTER DATABASE [AdventureWorks] SET AUTO_UPDATE_STATISTICS ON
Q. SELECT * FROM STATS WHERE name=’AK_Product_ProductNumber’

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.