Multiple choice technology databases

Which SQL statement is used to return only different values?

  1. SELECT DIFFERENT

  2. SELECT DISTINCT

  3. SELECT UNIQUE

  4. SELECT PRIMARY

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

SQL uses the DISTINCT keyword to return only different (unique) values from a column, eliminating duplicates. The syntax is 'SELECT DISTINCT column_name FROM table_name'. Option A 'SELECT DIFFERENT' is invalid SQL. Option C 'SELECT UNIQUE' is not standard SQL (some databases support it but it's not the standard). Option D 'SELECT PRIMARY' is not a valid SQL clause for this purpose.