Courseiva
Data Acquisition and PreparationmediumMultiple ChoiceObjective-mapped

DA0-002 Data Acquisition and Preparation Practice Question

A data analyst is using SQL to filter a sales table for transactions that occurred in either 'Q1' or 'Q3' of 2023 and have a sale amount greater than $100. Which WHERE clause correctly implements this condition?

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

WHERE quarter = 'Q1' AND amount > 100 OR quarter = 'Q3' AND amount > 100

Both C and D correctly implement the filter. SQL's operator precedence gives AND higher priority than OR, so option C is parsed as (quarter = 'Q1' AND amount > 100) OR (quarter = 'Q3' AND amount > 100), which is equivalent to (quarter = 'Q1' OR quarter = 'Q3') AND amount > 100. Option D expresses the same condition directly with parentheses.

Answer analysis

Option-by-option breakdown

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

  • WHERE quarter IN ('Q1','Q3') OR amount > 100

    Why it's wrong here

    This would include any transaction with amount>100 regardless of quarter.

  • WHERE quarter = 'Q1' OR quarter = 'Q3' AND amount > 100

    Why it's wrong here

    Missing parentheses; AND binds tighter, so this filters amount>100 only for Q3, not Q1.

  • WHERE quarter = 'Q1' AND amount > 100 OR quarter = 'Q3' AND amount > 100

    Why this is correct

    This is logically equivalent but redundant and not the standard concise form.

  • WHERE (quarter = 'Q1' OR quarter = 'Q3') AND amount > 100

    Why this is correct

    Correct: groups the OR and then AND with amount condition.

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.