# SUM

An aggregate function adding the non-NULL numeric values in a group.

## What is **SUM** in a relational database?

**SUM** — An aggregate function adding the non-NULL numeric values in a group.

```sql
SELECT customer_id, SUM(total_amount) AS order_total
FROM purchase_order
GROUP BY customer_id;
```

Level: Apprentice · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/apprentice)

Updated: September 28, 2026

Source: https://www.ask-codey.com/glossary/sum-database
