Bird
0
0

Which aggregate function counts all rows including those with NULL values in any column?

easy📝 Conceptual Q11 of 15
SQL - Aggregate Functions
Which aggregate function counts all rows including those with NULL values in any column?
ACOUNT(column_name)
BCOUNT(*)
CSUM(column_name)
DAVG(column_name)
Step-by-Step Solution
Solution:
  1. Step 1: Understand COUNT(*) behavior

    COUNT(*) counts every row in the table regardless of NULL values in any column.
  2. Step 2: Compare with COUNT(column_name)

    COUNT(column_name) counts only rows where the specified column is NOT NULL.
  3. Final Answer:

    COUNT(*) -> Option B
  4. Quick Check:

    COUNT(*) counts all rows including NULLs [OK]
Quick Trick: Use COUNT(*) to count all rows including NULLs [OK]
Common Mistakes:
MISTAKES
  • Thinking COUNT(column) counts all rows
  • Confusing SUM with COUNT
  • Assuming AVG counts NULLs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes