exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 242 discussion

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

You administer a Microsoft SQL Server database that includes a table named Products. The Products table has columns named ProductId, ProductName, and
CreatedDateTime.
The table contains a unique constraint on the combination of ProductName and CreatedDateTime.
You need to modify the Products table to meet the following requirements:
✑ Remove all duplicates of the Products table based on the ProductName column.
✑ Retain only the oldest Products row.
Which Transact-SQL query should you run?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B
You use the WHERE clause to delete a set of rows
Incorrect Answers:
A: Instead use the cte.CreatedDateTime > p.CreateDateTime condition.
C: Need to have a AND cte.CreatedDateTime > p.CreateDateTime condition.
D: Use MAX not MIN, and we need to have a AND cte.CreatedDateTime > p.CreateDateTime condition.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql

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
Why not A? We have to delete all the products which have date > then minimum
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 ...