SUM is an aggregate function which calculates the sum of a column. To find the sum of all order totals in the table, try:
Table orders
| order_id | customer | item | quantity | order_total |
|---|---|---|---|---|
| 1 | Alice | Laptop | 1 | 1200 |
| 2 | Bob | Mouse | 2 | 40 |
| 3 | Carlos | Monitor | 1 | 300 |
| 4 | Diana | Keyboard | 1 | 100 |
| 5 | Evan | Headphones | 1 | 150 |
SUM - Sum Aggregate - SQL Practice Online
Practise SUM - Sum Aggregate with 10 interactive SQL exercises. You type real queries into your browser and get instant feedback on every answer - no database setup and no install. It is a fast, hands-on way to learn SQL online and build query skills you can use at work.