DS0-001 · Question #141
A data analyst would like to select only one copy of each of the duplicated regions in the chart below: Which of the following SQL commands should the data analyst use to complete this task?
The correct answer is C. SELECT DISTINCT. SELECT DISTINCT is the standard SQL clause used to return only unique values from a column, eliminating duplicate rows from the result set - exactly what the analyst needs. SELECT COUNT() is an aggregate function that counts rows rather than filtering duplicates. SELECT UNIQUE is
Question
A data analyst would like to select only one copy of each of the duplicated regions in the chart below:
Which of the following SQL commands should the data analyst use to complete this task?
Exhibit
Options
- ASELECT COUNT()
- BSELECT UNIQUE
- CSELECT DISTINCT
- DSELECT DIFFERENT
How the community answered
(37 responses)- A3% (1)
- C92% (34)
- D5% (2)
Explanation
SELECT DISTINCT is the standard SQL clause used to return only unique values from a column, eliminating duplicate rows from the result set - exactly what the analyst needs. SELECT COUNT() is an aggregate function that counts rows rather than filtering duplicates. SELECT UNIQUE is not valid SQL syntax (it exists in Oracle PL/SQL in a different context, but is not standard SQL). SELECT DIFFERENT does not exist in SQL at all.
Memory tip: Think "DISTINCT = different instances" - the word distinct means clearly separate or unique, which maps directly to its SQL behavior of keeping only one copy of each value.
Topics
Community Discussion
No community discussion yet for this question.
