How does the average function work?

Question

How does the average function work?

Answer

When using the AVG() function, the computer will take all of the non-NULL values from a numeric column that’s provided, add them together, and divide the sum of those values by the total number of rows that had a non-NULL value. The resulting value will then be displayed in the result-set.

4 Likes