Which SQL statement is used to return only different values?
-
SELECT DIFFERENT
-
SELECT DISTINCT
-
SELECT UNIQUE
-
SELECT PRIMARY
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.