SQL - Aggregate FunctionsWhat does COUNT(*) count in a SQL query?AOnly rows where all columns are NOT NULLBAll rows, including those with NULL values in any columnCOnly rows where the specified column is NOT NULLDOnly rows with NULL values in any columnCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand what COUNT(*) doesCOUNT(*) counts every row in the table regardless of NULL values in any column.Step 2: Compare with other COUNT formsUnlike COUNT(column), COUNT(*) does not ignore NULLs because it counts rows, not column values.Final Answer:All rows, including those with NULL values in any column -> Option BQuick Check:COUNT(*) = counts all rows [OK]Quick Trick: COUNT(*) counts all rows, ignoring NULLs in columns [OK]Common Mistakes:MISTAKESThinking COUNT(*) ignores rows with NULLsConfusing COUNT(*) with COUNT(column)Assuming COUNT(*) counts only non-NULL columns
Master "Aggregate Functions" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - Self join for hierarchical data - Quiz 13medium GROUP BY and HAVING - GROUP BY with NULL values behavior - Quiz 9hard GROUP BY and HAVING - WHERE vs HAVING mental model - Quiz 6medium INNER JOIN - INNER JOIN with table aliases - Quiz 10hard LEFT and RIGHT JOIN - LEFT JOIN preserving all left rows - Quiz 1easy Set Operations - Why set operations are needed - Quiz 10hard Table Constraints - Composite primary keys - Quiz 10hard Table Relationships - One-to-one relationship design - Quiz 6medium Table Relationships - Foreign key linking mental model - Quiz 8hard Views - Dropping and altering views - Quiz 14medium