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?
- A.To remove duplicate rows from the final result setCorrect answer
- B.To sort the result set in ascending order
- C.To filter out NULL values from a specific column
- 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
- Which of the following clauses is evaluated first during the logical execution of a standard SQL SELECT query?
- Consider a table named employees with a column salary. Which query correctly retrieves all rows where the salary is between 40000 and 60000…
- How does SQL handle NULL values when comparing them with standard comparison operators like equals (=) or not equals (<>) in a WHERE clause?
- Which of the following clauses is used to filter rows after aggregate functions have been computed?
Practise more SQL
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed