Multiple choice technology mainframe

Which SQL statement is used to return only different values?

  1. SELECT DISTINCT

  2. SELECT DIFFERENT

  3. SELECT UNIQUE

  4. SELECT SAME

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

The SELECT DISTINCT statement is the standard SQL syntax used to return only unique (different) values from a query, filtering out duplicate rows. SELECT UNIQUE is an older, non-standard synonym supported by some databases, but DISTINCT is the primary standard keyword.

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.