The SQL AVG function returns the average value within a table or group. In this section, we’ll use the HumanResource.Employee table for our examples:

Using sample data above, AVG calculates the average SickLeaveHours amount for the entire table:
When used with GROUP BY, AVG returns the average value within a group. You can see this in this query showing the maximum SickLeaveHours by JobTitle:
Additional SQL AVG Resources
To learn more, check out these useful resources: