From af73a87c4c7fb3d8c4d334544a6b28e6d5856913 Mon Sep 17 00:00:00 2001 From: Joe Heffer <60133133+Joe-Heffer-Shef@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:13:50 +0000 Subject: [PATCH] Update episodes/02-sql-aggregation.md Co-authored-by: James Foster <38274066+jd-foster@users.noreply.github.com> --- episodes/02-sql-aggregation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/02-sql-aggregation.md b/episodes/02-sql-aggregation.md index 91aaaec4..336c52f8 100644 --- a/episodes/02-sql-aggregation.md +++ b/episodes/02-sql-aggregation.md @@ -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.