PrepAway - Latest Free Exam Questions & Answers

Which TransactSQL statement should you use?

You have a table named dbo.Customers. The table was created by using the following TransactSQL
statement:
CREATE TABLE dbo.Customers
(
CustomerID int IDENTITY(1,1) PRIMARY KEY CLUSTERED,
AccountNumber nvarchar(25) NOT NULL,
FirstName nvarchar(50) NOT NULL,
LastName nvarchar(50) NOT NULL,
AddressLine1 nvarchar(255) NOT NULL,
AddressLine2 nvarchar(255) NOT NULL,
City nvarchar(50) NOT NULL,
StateProvince nvarchar(50) NOT NULL,
Country nvarchar(50) NOT NULL,
PostalCode nvarchar(50) NOT NULL,
CreateDate datetime NOT NULL DEFAULT(GETDATE()),
ModifiedDate datetime NOT NULL DEFAULT(GETDATE())
)
You create a stored procedure that includes the AccountNumber, Country, and StateProvince
columns

from the dbo.Customers table. The stored procedure accepts a parameter to filter the output on the
AccountNumber column.
You need to optimize the performance of the stored procedure. You must not change the existing
structure of the table.
Which TransactSQL
statement should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
CREATE STATISTICS ST_Customer_AccountNumber
ON dbo.Customer (AccountNumber)
WITH FULLSCAN;

B.
CREATE CLUSTERED INDEX IX_Customer_AccountNumber
ON dbo.Customer (AccountNumber);

C.
CREATE NONCLUSTERED INDEX IX_Customer_AccountNumber
ON dbo.Customer (AccountNumber)
WHERE AccountNumber = ”;

D.
CREATE NONCLUSTERED INDEX IX_Customer_AccountNumber
ON dbo.Customer (AccountNumber)
INCLUDE (Country, StateProvince);


Leave a Reply