Question:

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.
  • len()
  • count()
  • number()
  • num()
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

In SQL, the COUNT() function is an aggregate function
used to count the number of rows that match a specified condition.
When used on a column, COUNT() counts only the non-NULL values.
It ignores any NULL entries in that column automatically.
len(), number(), and num() are not valid SQL aggregate functions.
len() exists in Python but not in SQL.
Therefore, the function that counts values ignoring NULLs is COUNT().
So, option (B) is correct.
Was this answer helpful?
0
0

Top Questions on SQL

View More Questions

Questions Asked in CBSE CLASS XII exam

View More Questions