SQL - Aggregate FunctionsWhy does the SQL AVG() function ignore NULL values when calculating the average?ABecause NULL values cause AVG() to return NULL alwaysBBecause NULL is treated as zero in AVG()CBecause AVG() only works on non-nullable columnsDBecause NULL means unknown, so it is excluded from calculationsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand NULL meaning in SQLNULL represents unknown or missing data, not zero or any number.Step 2: AVG() ignores NULL to avoid skewing resultsIncluding NULL as zero would lower average incorrectly, so NULLs are excluded.Final Answer:Because NULL means unknown, so it is excluded from calculations -> Option DQuick Check:NULL excluded in AVG() because it's unknown [OK]Quick Trick: NULL means unknown, so AVG() skips it [OK]Common Mistakes:MISTAKESTreating NULL as zeroExpecting AVG() to return NULL if any NULL present
Master "Aggregate Functions" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - Natural join and its risks - Quiz 10hard Advanced Joins - FULL OUTER JOIN behavior - Quiz 8hard Advanced Joins - Join order and performance impact - Quiz 10hard Aggregate Functions - COUNT(*) vs COUNT(column) difference - Quiz 6medium Aggregate Functions - MIN and MAX functions - Quiz 2easy INNER JOIN - Why joins are needed - Quiz 1easy LEFT and RIGHT JOIN - LEFT JOIN preserving all left rows - Quiz 2easy Table Constraints - FOREIGN KEY constraint - Quiz 11easy Table Constraints - UNIQUE constraint - Quiz 3easy Views - Why views are needed - Quiz 14medium