Courseiva
Data Acquisition and PreparationmediumMultiple ChoiceObjective-mapped

DA0-002 Data Acquisition and Preparation Practice Question

Exhibit

SELECT * FROM sales WHERE date BETWEEN '2023-01-01' AND '2023-12-31';

Refer to the exhibit. If the date column is stored as a string in 'MM/DD/YYYY' format, what will be the result?

⚠ Common exam trap

CompTIA often tests the misconception that string comparison of dates in 'MM/DD/YYYY' format will yield correct chronological order, but the trap is that lexicographic comparison compares month first, not year, leading to incorrect results.

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

Incorrect results because string comparison is lexicographic.

When dates are stored as strings in 'MM/DD/YYYY' format, string comparison is lexicographic (character-by-character). This means that '01/02/2023' (January 2) would be considered greater than '12/31/2022' because '0' > '1' at the first character, leading to incorrect chronological ordering. The comparison does not interpret the string as a date value.

Answer analysis

Option-by-option breakdown

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

  • Incorrect results because string comparison is lexicographic.

    Why this is correct

    The different format causes lexicographic comparison to fail.

  • NULL values

    Why it's wrong here

    The query does not produce NULLs; it may return no rows or incorrect rows.

  • Error because DATE type is expected.

    Why it's wrong here

    The query will run, but the comparison will be string-based.

  • Correct results because string comparison works for dates.

    Why it's wrong here

    String comparison does not recognize date semantics and will compare character by character.

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.