IF()
IF(condition, a, b) is a function: IF(marks >= 40, 'Pass', 'Fail'). CASE is clearer for many branches. IF as a procedure statement (IF THEN END IF) is different — that is flow control inside stored programs.
Trap — mixing IF() function with procedural IF. Trap: nested IF() soup — use CASE.
On the example next to this theory: IF(): create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
IF(marks >= 40, 'Pass', 'Fail') or CASE WHEN …