AVG()()
AVG(marks) = SUM/COUNT of non-NULL marks. Absentees (NULL) don’t pull the average down. If they should count as 0, AVG(IFNULL(marks,0)).
ROUND(AVG(marks), 2) for two decimals.
Trap — averaging in PHP after SELECT * of 1 lakh rows.
On the example next to this theory — AVG()() — aggregate functions collapse many rows into one summary row.
Exam tip
AVG(marks) ignores NULL. AVG(IFNULL(marks,0)) includes as 0.