Functions
A function returns a value in a SELECT: COUNT, AVG, CONCAT, NOW(). Aggregate functions squash rows (need GROUP BY for per-group). Scalar functions run per row (UPPER(name)).
SELECT CONCAT(name, ' ', roll), UPPER(city), NOW() FROM students; You can nest: ROUND(AVG(marks), 1).
Trap — putting UPPER(name) in WHERE on a huge table (index on name may not apply). Trap: COUNT(col) vs COUNT(*).
On the example next to this theory: Functions: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
Exam tip
Per-row: UPPER(name). Aggregate: AVG(marks) with GROUP BY.