Databricks Certified Data Engineer Associate — Question 121
Which of the following commands will return the number of null values in the member_id column?
Answer options
- A. SELECT count(member_id) FROM my_table;
- B. SELECT count(member_id) - count_null(member_id) FROM my_table;
- C. SELECT count_if(member_id IS NULL) FROM my_table;
- D. SELECT null(member_id) FROM my_table;
Correct answer: C
Explanation
The correct answer is C because the count_if function specifically counts the number of rows where member_id is NULL. Option A counts all non-null member_id values, Option B incorrectly attempts to subtract a null count from a total count, and Option D does not return a count at all.