Search⌘ K
AI Features

Group Things Together

Explore how to group rows sharing the same value using SQL Group By. Learn to apply aggregate functions such as count and average within groups, enabling you to summarize data like counts of people by city or average pet age by type.

You already know how to calculate totals, averages, and counts. But what if you want those numbers for each group, like each city or pet type? Instead of just “How many pets?” You want: “How many pets of each type?” That’s where GROUP BY shines.

Goal

You’ll aim to: ...