Which SQL statement is used to return only different values?

  1. SELECT DISTINCT

  2. SELECT DIFFERENT

  3. SELECT UNIQUE

  4. SELECT SAME


Correct Option: A

AI Explanation

To answer this question, you need to understand the purpose of the DISTINCT keyword in SQL.

Option A) SELECT DISTINCT - This option is correct because the DISTINCT keyword is used in a SELECT statement to return only unique/distinct values from a column or set of columns. It eliminates duplicate rows from the result set.

Option B) SELECT DIFFERENT - This option is incorrect because there is no SQL keyword called "DIFFERENT". It is not a valid SQL statement.

Option C) SELECT UNIQUE - This option is incorrect because there is no SQL keyword called "UNIQUE" that is used to return only different values. The UNIQUE keyword is used to specify that a column or set of columns must contain unique values.

Option D) SELECT SAME - This option is incorrect because there is no SQL keyword called "SAME" that is used to return only different values. It is not a valid SQL statement.

The correct answer is Option A) SELECT DISTINCT. This option is correct because the DISTINCT keyword is used to return only unique/distinct values from a column or set of columns.

Find more quizzes: