Which of the following clause is used with SELECT command in MySQL to avoid…

2023

Which of the following clause is used with SELECT command in MySQL to avoid duplication of output rows. MySQL

  1. A.

    NO DUPLICATE / NO DUPLICATE

  2. B.

    UNIQUE / UNIQUE

  3. C.

    DISTINCT / DISTINCT

  4. D.

    NO REPEAT / NO REPEAT

Attempted by 2470 students.

Show answer & explanation

Correct answer: C

Correct clause: DISTINCT

Explanation: Use DISTINCT with the SELECT statement to remove duplicate rows from the query result. DISTINCT ensures that each returned row is unique across the listed columns.

  • Example (single column): SELECT DISTINCT column_name FROM table_name;

  • Example (multiple columns): SELECT DISTINCT col1, col2 FROM table_name; — returns unique combinations of col1 and col2.

Note: UNIQUE is used as a column constraint or index to enforce uniqueness at the table/schema level and is not a SELECT clause. Phrases like 'NO DUPLICATE' or 'NO REPEAT' are not valid MySQL SELECT clauses.

Explore the full course: Up Lt Grade Assistant Teacher 2025