exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 245 discussion

Actual exam question from Microsoft's 70-461
Question #: 245
Topic #: 1
[All 70-461 Questions]

You are designing a Microsoft SQL Server database named Orders.
You create a table by running the following Transact-SQL statement:

You create a stored procedure to be used by an ASP.NET application that runs the following statement:

You need to ensure that the query runs as efficiently as possible.
Which Transact-SQL statement should you run?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B
Creating a primary key automatically creates a corresponding unique clustered index, or a nonclustered index if specified as such.
Example: To create a primary key in an existing table
The following example creates a primary key on the column TransactionID in the AdventureWorks database.
ALTER TABLE Production.TransactionHistoryArchive
ADD CONSTRAINT PK_TransactionHistoryArchive_TransactionID PRIMARY KEY CLUSTERED (TransactionID);
References:
https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-primary-keys

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
lilupv
4 years, 11 months ago
I think it is A or D. We have to optimize the stored procedure. UserName is in the WHERE clause
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...