Basics & SELECT Queries · SQL SQL

What is the primary purpose of the DISTINCT keyword in a SELECT statement?

Practice question from Basics & SELECT Queries (SQL SQL), with the correct answer and a step-by-step solution.

easy · MCQ · Q-31F7A9

What is the primary purpose of the DISTINCT keyword in a SELECT statement?

  1. A.To remove duplicate rows from the final result setCorrect answer
  2. B.To sort the result set in ascending order
  3. C.To filter out NULL values from a specific column
  4. D.To rename column headers in the output

Solution

The DISTINCT keyword instructs the database engine to eliminate duplicate rows from the resulting dataset, returning only unique combinations of values.

More from Basics & SELECT Queries

All of Basics & SELECT Queries

Practise more SQL

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed