Question:medium

Which aggregate function in SQL displays the number of values in the specified column ignoring the NULL values?

Show Hint

Use COUNT(*) to count all rows including NULLs,
and COUNT(column_name) to count only non-NULL entries.
Updated On: Jan 14, 2026
  • len()
  • count()
  • number()
  • num()
Show Solution

The Correct Option is B

Solution and Explanation

In SQL, COUNT() is an aggregate function that determines the number of rows satisfying a given condition. When applied to a column, COUNT() specifically tallies non-NULL values, automatically disregarding any NULL entries. Functions such as len(), number(), and num() are not recognized as valid SQL aggregate functions. While len() is present in Python, it is not a SQL function. Consequently, COUNT() is the correct function for counting values while excluding NULLs. Thus, option (B) is correct.
Was this answer helpful?
0