The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column.
The COUNT(*) function returns the number of records in a table either null or non null.
So average salary = sum(salary)/ count (salary).
if a value is null out of 4 then count (salary) will give 3
so average will be sum / 3 while actually result should be divided by 4