Question 199 of 509
Comparing and Contrasting Data ConceptsmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct modification is to add `OR last_visit_date IS NULL` to the WHERE clause. This works because SQL NULL handling dictates that any comparison involving a NULL value—such as `last_visit_date < DATEADD(year, -2, GETDATE())`—evaluates to UNKNOWN rather than TRUE or FALSE, so those rows are automatically excluded from results. For the CompTIA Data+ DA0-001 exam, this scenario tests your understanding of how NULLs interact with date queries and conditional logic, a common trap where analysts forget that NULL is not a value but a marker for missing data. The exam often presents a date query returning zero rows to mislead you into thinking the date arithmetic is wrong, when the real issue is unhandled NULLs. A quick memory tip: think of NULL as "I don't know"—if you ask whether an unknown date is before two years ago, the answer is always "I don't know," not "yes."

DA0-001 Comparing and Contrasting Data Concepts Practice Question

This DA0-001 practice question tests your understanding of comparing and contrasting data concepts. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A healthcare organization maintains a database of patient records. The database has a table 'patients' with columns: patient_id (primary key), first_name, last_name, date_of_birth, gender, and last_visit_date. A data analyst is tasked with creating a report that lists all patients who have not visited in the last two years. The analyst writes a query: SELECT * FROM patients WHERE last_visit_date < DATEADD(year, -2, GETDATE()); However, the query returns zero rows, even though the analyst knows there are patients who have not visited for over two years. Upon inspection, the analyst discovers that the last_visit_date column contains NULL values for patients who have never visited. Which modification to the query should the analyst make to include patients with NULL last_visit_date?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "primary"

    Why it matters: Asks for the main purpose or function, not a secondary benefit. Eliminate answers that describe side-effects or partial functions.

  • Clue: "never"

    Why it matters: Absolute qualifier. True only if the statement has zero exceptions — be cautious of options that seem obvious but break down in edge cases.

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

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

Add OR last_visit_date IS NULL to the WHERE clause.

The original query uses a WHERE clause that compares last_visit_date to a computed date, but NULL comparisons in SQL always yield UNKNOWN, so rows with NULL last_visit_date are excluded. Adding OR last_visit_date IS NULL explicitly includes those rows, ensuring patients who have never visited are listed in the report.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Remove the WHERE clause entirely.

    Why it's wrong here

    Returns all patients, not just those not visited.

  • Add OR last_visit_date IS NULL to the WHERE clause.

    Why this is correct

    Includes NULLs in the result.

    Clue confirmation

    The clue words "primary&quot;, &quot;never" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use COALESCE(last_visit_date, '1900-01-01') in the WHERE clause.

    Why it's wrong here

    COALESCE could work but may not be intuitive and depends on the replacement value.

  • Add AND last_visit_date IS NOT NULL to the WHERE clause.

    Why it's wrong here

    This excludes NULLs, making the problem worse.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often forget that NULL comparisons in SQL do not return TRUE, leading them to incorrectly think the original query already handles NULLs, and they may choose Option C (COALESCE) as a workaround instead of the simpler and correct IS NULL check.

Detailed technical explanation

How to think about this question

In SQL, NULL represents an unknown or missing value, and any comparison with NULL (e.g., <, >, =) evaluates to UNKNOWN, not TRUE or FALSE, so rows with NULL are filtered out by default. Using IS NULL or IS NOT NULL is the only reliable way to test for NULLs; functions like COALESCE or ISNULL can work but may introduce performance overhead or unexpected behavior if the replacement value affects the comparison logic. In a healthcare reporting scenario, including patients with NULL last_visit_date is critical for identifying those who have never been seen.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DA0-001 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DA0-001 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DA0-001 question test?

Comparing and Contrasting Data Concepts — This question tests Comparing and Contrasting Data Concepts — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Add OR last_visit_date IS NULL to the WHERE clause. — The original query uses a WHERE clause that compares last_visit_date to a computed date, but NULL comparisons in SQL always yield UNKNOWN, so rows with NULL last_visit_date are excluded. Adding OR last_visit_date IS NULL explicitly includes those rows, ensuring patients who have never visited are listed in the report.

What should I do if I get this DA0-001 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "primary", "never". Asks for the main purpose or function, not a secondary benefit. Eliminate answers that describe side-effects or partial functions.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DA0-001 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-001 exam.