IFNULL()
IFNULL(marks, 0) returns marks if not NULL, else 0. Two arguments only. COALESCE(a,b,c) walks the list. In SELECT lists IFNULL is the student favourite.
Trap — IFNULL as a WHERE — you usually still want IS NULL for ‘missing’ vs 0.
On the example next to this theory: IFNULL(): create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
IFNULL(marks, 0). COALESCE(marks, bonus, 0).