Free CompTIA DA0-002 Actual Exam Questions - Question 7 Discussion
[Data Analysis]
A data analyst creates a report, and some of the fields are empty. Which of the following conditions should the analyst add to a query to provide a list of all the records with empty fields?
A/D are wrong because = NULL or = 'NULL' doesn’t work for actual NULL values in SQL. C is the opposite of what’s needed. B is the standard way to check for real NULLs without mixing in empty strings.
B is best, but just make sure the empty fields aren’t blank strings instead of NULLs.
It’s definitely B again from me. Using = NULL (A) or in quotes (D) doesn’t match how SQL handles nulls—it’s not a value you can compare with equals. Also, C obviously filters out the empty fields, so that’s the opposite of what we want. B is the only one that actually returns rows where the field is truly empty (NULL). This is pretty standard SQL behavior across all the major platforms.
It’s B. The only correct way to check for NULLs in SQL is with IS NULL, not using equals or quotes. That’s standard across all common SQL databases.
B. Besides the standard syntax, using "IS NULL" also avoids errors or unexpected results in most SQL engines. Options A and D try to use equals, which just doesn’t work with NULL values since NULL means unknown or missing. C is definitely out because it filters for non-empty fields. So B is not only correct but the only reliable choice here.
Option B makes the most sense to me because SQL treats NULL as a special value that can’t be compared with equals. Using IS NULL is the proper syntax to find empty fields. Options A and D won’t work since = NULL or = 'NULL' don’t actually detect nulls, and C is the opposite of what we want. This is pretty standard across most SQL databases, so B is the straightforward choice here.
B imo, because NULL is a special marker that means "no value," and you can’t use equals to check for it. A and D don’t work since = NULL or = 'NULL' won’t catch actual nulls. C’s the opposite of what the question wants anyway, so that’s out. Most SQL dialects agree on IS NULL as the proper way to find empty fields.
B imo, because in SQL you check for null with IS NULL, not equals. But anyone else think it depends on the database?