DA0-002 Data Acquisition and Preparation Practice Question
A data analyst runs a query to count the number of customers in each city. The query uses COUNT(*) and GROUP BY city. However, the result includes NULL for some cities. What will COUNT(*) return for a group where the city is NULL?
⚠ Common exam trap
DA0-002 often tests the difference between COUNT(*) and COUNT(column) with NULLs, tricking candidates into thinking COUNT(*) returns NULL or 0 when the grouped column is NULL.
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
✓
The number of rows with NULL city
COUNT(*) counts rows, not non-NULL values, so for a group where city IS NULL it returns the number of rows in that group. The NULL city forms its own group under GROUP BY because SQL treats NULLs as equal for grouping purposes. This differs from COUNT(city), which would return 0 for that group because it ignores NULLs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
NULL
Why it's wrong here
COUNT(*) never returns NULL; it returns the number of rows in the group, and NULL city values are grouped and counted like any other value. It is tempting because NULL propagates through many SQL expressions, and would be correct for a bare column reference such as city in the SELECT list.
- ✗
0
Why it's wrong here
COUNT(*) counts rows in each group, including rows whose city value is NULL, so a NULL group returns its actual row count, not zero. It is tempting because zero seems the natural result for an absent value, and would be correct for COUNT(city), which ignores NULLs.
- ✓
The number of rows with NULL city
Why this is correct
COUNT(*) counts every row in the group regardless of NULL values, so a group where city is NULL returns the total number of rows having a NULL city. COUNT(city) would instead return zero for that group.
- ✗
The number of non-NULL cities
Why it's wrong here
COUNT(*) tallies every row in the group, including rows where city is NULL, so it returns the total row count rather than a count of non-NULL cities. COUNT(city) is the function that ignores NULLs and would answer the stem's question about non-NULL values.
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 →
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.