MODULE 2 · Shaping results
Reading · 15 min
Aggregating data
Aggregating data
Aggregate functions turn rows into a summary. They are useful when the question is about a group rather than each individual record.
Learning objectives
- Use COUNT and SUM
- Group related records
Summarize many records with COUNT, SUM, and AVG. Focus on explaining each decision in your own words before relying on a pattern or shortcut.
Example
SELECT status, COUNT(*) AS order_count
FROM orders
GROUP BY status;Summary
KEY TAKEAWAYS
- Aggregates summarize sets of rows.
- GROUP BY defines which rows belong together.
Reading material
Aggregating data practice prompt
Use the exercise in this lesson to check your understanding.
Your progress is saved on this device. Sign in to keep it across devices.
