Which SQL keyword is used to eliminate duplicate tuples from the result…
2021
Which SQL keyword is used to eliminate duplicate tuples from the result relation?
Answer: B. DISTINCT — ConceptA SELECT query normally returns every row produced by its projection and filtering steps, including repeated rows. The DISTINCT modifier applies…
- A.
DELETE
- B.
DISTINCT
- C.
NON DUPLICATE
- D.
EXISTS
Show answer & explanation
Correct answer: B
Concept
A SELECT query normally returns every row produced by its projection and filtering steps, including repeated rows.
The DISTINCT modifier applies set-style duplicate elimination to the selected result rows; it does not delete rows from the stored table.
Application
Suppose a column contains the values Delhi, Delhi, and Jaipur.
SELECT city FROM centres returns all three rows, so Delhi appears twice.
SELECT DISTINCT city FROM centres compares the projected city values and returns Delhi and Jaipur once each.
Contrast
DELETE removes stored rows that satisfy a condition; it is not a modifier for deduplicating a query result.
NON DUPLICATE is not a standard SQL keyword.
EXISTS tests whether a subquery returns at least one row; it does not collapse repeated result rows.
Result
Therefore, the keyword used to eliminate duplicate tuples from the result relation is DISTINCT.