Skip to content

Commit

Permalink
Update episodes/02-sql-aggregation.md
Browse files Browse the repository at this point in the history
Co-authored-by: James Foster <[email protected]>
  • Loading branch information
Joe-Heffer-Shef and jd-foster authored Jan 23, 2025
1 parent 366c258 commit af73a87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion episodes/02-sql-aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Write a query that returns, from the `species` table, the number of

## Solution

This query counts the number of species records that contain each value of the `taxa` field and names that result `species_count`.
This query counts the number of times each value (Bird, Rabbit, Reptile or Rodent) in the `taxa` field occurs, defining a new field named `taxa_count` to hold the result.
The `GROUP BY` clause means the query will create an aggregated table with one row for each taxa.
Only those `taxa` values that have more than ten records will be included because of the `HAVING` clause.
This filtering is applied _after_ grouping has been done.
Expand Down

0 comments on commit af73a87

Please sign in to comment.