Courseiva

DA0-002 Data Acquisition and Preparation Practice Question

A dataset contains sales transactions with columns 'order_date', 'amount', and 'region'. The analyst wants to calculate the total sales per region for orders placed in 2023, but only include regions where total sales exceed $10,000. Which SQL clause should be used to filter the aggregated results?

⚠ Common exam trap

DA0-002 often tests the WHERE vs. HAVING distinction — candidates pick WHERE because it 'filters,' forgetting that WHERE cannot reference aggregate functions.

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

✓

HAVING

HAVING is the SQL clause that filters rows after aggregation, so it can reference aggregate functions like SUM(amount) and apply conditions such as SUM(amount) > 10000. WHERE runs before GROUP BY and cannot reference aggregates, so it cannot filter on total sales per region.

Answer analysis

Option-by-option breakdown

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

  • ✓

    HAVING

    Why this is correct

    HAVING filters groups after aggregation, unlike WHERE, which filters individual rows before grouping. Since the $10,000 threshold applies to SUM(amount) per region, not to individual transactions, HAVING is the only clause that can evaluate the aggregated total and exclude regions failing it.

  • ✗

    WHERE

    Why it's wrong here

    WHERE filters individual rows before aggregation, so it cannot evaluate SUM(amount) per region. HAVING applies conditions to grouped aggregates. WHERE would be correct for restricting rows by order_date or region before grouping, but not for testing a total that only exists after GROUP BY.

  • ✗

    GROUP BY

    Why it's wrong here

    GROUP BY forms the region groups but applies no condition to the aggregated totals, so it cannot exclude regions below $10,000. HAVING performs that filtering. GROUP BY would be correct as the clause that creates the per-region buckets, but the question asks which clause filters the aggregated results.

  • ✗

    FILTER

    Why it's wrong here

    FILTER is a window function clause restricting rows within an aggregate, not a post-aggregation filter on grouped results. HAVING is the clause that filters aggregated output. FILTER would be correct for conditional aggregation inside a single query, not for excluding regions whose summed sales fall below a threshold.

About these practice questions

This DA0-002 question is part of Courseiva's 1,004-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.