Skip to content
Chapter Practice Arena

Grouping Data Problems

Targeted practice challenges specifically curated for this chapter. Inspect hints, verify outputs, and check verified solutions.

All Chapters
Filter by Language:8 Problems
Filter by SQL Chapter:
Difficulty:
Chapter:
Showing 6 challenges · 8 total · Page 1 of 2
#1intermediateGrouping Rows with GROUP BY
18. GROUP BY with Joins: A Preview
Starter Code
-- Practice query for Grouping Rows with GROUP BY
Expected Output
Formatted Result

Illustrative output:

customer_idcustomer_nameorder_counttotal_spent
1Asha31500
2Ravi1400
3Neha00
3 rows returned4 columns
10. Ratios Between Groups and Metrics
Starter Code
-- Practice query for Combining Aggregates and Grouping
Expected Output
Formatted Result

Illustrative output:

categorytotal_salesorder_countaverage_amount_per_order
Electronics12003400.00
Books6002300.00
2 rows returned4 columns
13. Filtering and Sorting a Combined Report
Starter Code
-- Practice query for Combining Aggregates and Grouping
Expected Output
Formatted Result

Illustrative output:

categoryorder_counttotal_salesaverage_amountminimum_amountmaximum_amount
Electronics84200525.001001000
Furniture52500500.00200800
2 rows returned6 columns
5. Multi-Dimensional Reporting
Starter Code
-- Practice query for Combining Aggregates and Grouping
Expected Output
Formatted Result

Illustrative output:

departmentcategorysale_line_countunits_soldtotal_revenueaverage_line_revenue
RetailElectronics815120001500.00
OnlineBooks10306000600.00
2 rows returned6 columns
7. Combining WHERE and HAVING Correctly
Starter Code
-- Practice query for Understanding WHERE vs HAVING
Expected Output
Formatted Result

Illustrative output:

categorycompleted_order_countcompleted_sales
Electronics84200
Furniture52500
2 rows returned3 columns
#6intermediateGrouping Rows with GROUP BY
8. Combining Multiple Aggregate Functions
Starter Code
-- Practice query for Grouping Rows with GROUP BY
Expected Output
Formatted Result

Illustrative output:

categoryorder_counttotal_salesaverage_ordersmallest_orderlargest_order
Electronics31000333.33200500
Books2300150.00100200
2 rows returned6 columns