SUM
Adds up values from many rows and returns the total.
Syntax
SUM(<expression>)
SUM(DISTINCT <expression>)
An aggregate function: it turns a group of rows into one number — the total. It skips NULL. Together with GROUP BY it calculates the total separately for each group: revenue by month, salaries by department.