Given a sales table with columns Region and Sales, what is the result of this query?
=QUERY(A1:B7, "SELECT A, SUM(B) GROUP BY A", 1)
Data in A1:B7:
Region | Sales North | 100 South | 150 North | 200 East | 50 South | 100 East | 150
=QUERY(A1:B7, "SELECT A, SUM(B) GROUP BY A", 1)
Remember that SUM(B) adds all sales per region.
The query groups rows by region and sums the sales. North has 100 + 200 = 300, South has 150 + 100 = 250, East has 50 + 150 = 200.
Which of the following QUERY formulas correctly groups data by Category and counts the number of entries?
Check the order of clauses: SELECT, GROUP BY.
Option A correctly uses SELECT A, COUNT(B) GROUP BY A. Other options have syntax errors or wrong clause order.
You want to find the total sales per Region and Product. Which QUERY formula is the most efficient and correct?
When grouping by multiple columns, list all in GROUP BY clause.
Option B correctly groups by both Region (A) and Product (B) and sums sales (C). Others miss grouping columns or select columns not grouped.
What error will this QUERY formula produce?
=QUERY(A1:B10, "SELECT A, SUM(B)", 1)
Assuming columns A and B have data.
=QUERY(A1:B10, "SELECT A, SUM(B)", 1)
When using aggregation, non-aggregated columns must be in GROUP BY.
The query selects column A and SUM(B) but does not group by A, causing an error.
Consider this QUERY formula:
=QUERY(A1:C15, "SELECT A, SUM(C) GROUP BY A HAVING SUM(C) > 100", 1)
What does the HAVING clause do here?
=QUERY(A1:C15, "SELECT A, SUM(C) GROUP BY A HAVING SUM(C) > 100", 1)
HAVING filters after grouping and aggregation.
HAVING applies conditions on aggregated groups. Here it keeps groups with sum of C > 100.