Mark As Completed Discussion

AVG

This aggregate function is used for calculating the average of the values in a specific column. This is a very useful aggregate function, but it should be noted that it may only be used on columns containing numerical values. What’s more, avg() completely ignores all null values in the column. Sometimes, this is a downside because we may want to treat the nulls as zeroes, in which case, we’ll have to run a command to manually perform that conversion.

The syntax of the avg() function is as follows:

TEXT/X-SQL
1SELECT AVG(column)
2FROM table
3WHERE condition;