nerdexam
CompTIA

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

Database Fundamentals

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

DS0-001 question #141 exhibit

Options

  • ASELECT COUNT()
  • BSELECT UNIQUE
  • CSELECT DISTINCT
  • DSELECT DIFFERENT

How the community answered

(37 responses)
  • A
    3% (1)
  • C
    92% (34)
  • D
    5% (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

#SQL DISTINCT#Duplicate records#SELECT statements

Community Discussion

No community discussion yet for this question.

Full DS0-001 Practice