Which SQL statement is used to return only different values?

  1. SELECT DIFFERENT

  2. SELECT UNIQUE

  3. SELECT DISTINCT

  4. SELECT EXACT


Correct Option: C

AI Explanation

To answer this question, you need to understand how to retrieve only distinct values from a table using SQL queries. Let's go through each option to understand why it is correct or incorrect:

Option A) SELECT DIFFERENT - This option is incorrect because there is no SQL keyword or function called "DIFFERENT" to retrieve only different values.

Option B) SELECT UNIQUE - This option is incorrect because "UNIQUE" is not used as a keyword or function to retrieve only different values. Instead, "UNIQUE" is used to enforce uniqueness on a column or a combination of columns in a table.

Option C) SELECT DISTINCT - This option is correct because the "DISTINCT" keyword is used in SQL to retrieve only different values from a column or a combination of columns in a table. It eliminates duplicate values and returns only unique values.

Option D) SELECT EXACT - This option is incorrect because there is no SQL keyword or function called "EXACT" to retrieve only different values.

The correct answer is Option C) SELECT DISTINCT. This option is correct because the "DISTINCT" keyword is used to return only different values.

Find more quizzes: