Multiple choice technology mainframe

Which of the following statements eliminates all but one of each set of duplicate rows in the final result table?

  1. SELECT UNIQUE * FROM t1

  2. SELECT DISTINCT * FROM t1

  3. SELECT UNIQUE (*) FROM t1

  4. SELECT DISTINCT (*) FROM t1

  5. None of above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The SELECT DISTINCT clause eliminates duplicate rows from a result set, returning only one instance of each unique row. The DISTINCT keyword is applied to the entire row (all columns), so rows must match in every column to be considered duplicates. The UNIQUE keyword and parentheses syntaxes are not valid SQL - the correct form is DISTINCT without parentheses around the asterisk.