Courseiva
Data Acquisition and PreparationmediumMultiple SelectObjective-mapped

DA0-002 Data Acquisition and Preparation Practice Question

A data analyst needs to identify duplicate customer records based on email and phone number. Which SQL techniques can be used to find duplicates? (Select TWO).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use a CTE to assign ROW_NUMBER() and then select rows where rn > 1

GROUP BY with COUNT and HAVING COUNT > 1 filters groups with duplicates. ROW_NUMBER() with PARTITION BY can assign row numbers to identify duplicates.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • SELECT email, phone FROM customers ORDER BY email, phone

    Why it's wrong here

    ORDER BY sorts but does not identify duplicates.

  • SELECT DISTINCT email, phone FROM customers

    Why it's wrong here

    DISTINCT removes duplicates, but does not identify them.

  • SELECT email, phone, ROW_NUMBER() OVER (PARTITION BY email, phone ORDER BY customer_id) AS rn FROM customers WHERE rn > 1

    Why it's wrong here

    Cannot reference window function alias in WHERE; must be in a subquery.

  • Use a CTE to assign ROW_NUMBER() and then select rows where rn > 1

    Why this is correct

    A CTE with ROW_NUMBER() can identify duplicates by filtering on rn > 1.

  • SELECT email, phone, COUNT(*) FROM customers GROUP BY email, phone HAVING COUNT(*) > 1

    Why this is correct

    This groups by the columns and returns groups with more than one row (duplicates).

About these practice questions

This DA0-002 question is part of Courseiva's 986-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.