What does the following query demonstrate about NULL handling in aggregates? SELECT AVG(bonus) FROM employees

SQL Fundamentals Hard

SQL Fundamentals — Hard

What does the following query demonstrate about NULL handling in aggregates? SELECT AVG(bonus) FROM employees

Key points

  • AVG in SQL excludes NULL values from the calculation
  • It divides the sum by the count of non-NULL rows
  • This can lead to inaccurate results if NULL values are not accounted for
  • Understanding NULL handling in aggregates is crucial for accurate calculations

Ready to go further?

Related questions