sum()
SUM(marks) adds numbers. NULLs ignored. SELECT SUM(marks) FROM students WHERE city='Pune'; SUM with GROUP BY city.
SUM of no rows is NULL. COALESCE(SUM(marks),0) for 0.
Trap — SUM on a string column. Trap: SUM(DISTINCT …) unless you really mean unique values only.
On the example next to this theory — sum() — aggregate functions collapse many rows into one summary row.
Exam tip
SELECT city, SUM(marks) FROM students GROUP BY city;