This question is ambiguous, it has not been told that COUNT is applied on the attribute "rating" or on the whole table.
if count is applied on the attribute "rating" then sum(rating)/count(rating) will be equal to avg(rating).
and if count is applied on the whole table and then sum(rating) is divided by count(*) then, it will have smaller value than avg(rating) if rating contains few NULL values.