Recall & Review
beginner
What does the GROUP BY clause do in a query?
GROUP BY groups rows that have the same values in specified columns into summary rows, like grouping all sales by each product.
Click to reveal answer
beginner
Which function would you use to find the total sum of a column after grouping?
You use the SUM() function to add up values in a column for each group.
Click to reveal answer
intermediate
How do you write a query to count the number of entries per category in Google Sheets QUERY function?
Use: SELECT Category, COUNT(Column) GROUP BY Category
Click to reveal answer
beginner
Why do you need to use GROUP BY when using aggregation functions?
Because aggregation functions like SUM or COUNT summarize data per group, GROUP BY tells the query how to group rows before summarizing.
Click to reveal answer
intermediate
In Google Sheets QUERY, what happens if you use an aggregation function without GROUP BY?
The aggregation function will calculate over the entire data set, returning a single summary value instead of grouped results.
Click to reveal answer
What does the GROUP BY clause do in a Google Sheets QUERY?
✗ Incorrect
GROUP BY groups rows that share the same values in specified columns to prepare for aggregation.
Which aggregation function counts the number of rows in each group?
✗ Incorrect
COUNT() counts the number of rows or non-empty values in each group.
What will this QUERY return? SELECT Category, SUM(Sales) GROUP BY Category
✗ Incorrect
It sums sales values for each category separately.
If you forget to add GROUP BY when using SUM(), what happens?
✗ Incorrect
Without GROUP BY, SUM() calculates the total over all rows.
Which of these is a valid Google Sheets QUERY with grouping?
✗ Incorrect
When using COUNT() with another column, you must GROUP BY that column.
Explain how GROUP BY works with aggregation functions in Google Sheets QUERY.
Think about how you would summarize sales by product category.
You got /3 concepts.
Describe a real-life example where you would use GROUP BY with SUM in Google Sheets.
Imagine you want to know total sales per product.
You got /3 concepts.