Loading…
Loading…
Twenty-six questions on COUNT, SUM, AVG, MIN and MAX, NULLs and empty inputs, GROUP BY and HAVING, ROLLUP, CUBE, GROUPING SETS and GROUPING(), and conditional aggregation with CASE and FILTER, with explanations.
Review quiz for Part 4 (Aggregation) of the SQL course:
The questions use the shop database from Part 3:
products (7 rows): two tents, two lighting products, two packs and one pair of socks. The Basecamp lantern has a NULL brand and a NULL weight_g. Stock adds up to 167, and the Day 18 backpack has 0 in stock.customers (6 rows): Asha (1), Ben (2), Chen (3), Dana (4), Eli (5) and Farah (6). Eli and Farah have no orders, and Farah's city is NULL.orders (6 rows): 101 and 103 by Asha, 102 by Ben, 104 by Chen (pending), 105 by Dana (cancelled), and 106, a guest order with a NULL customer_id. Orders 101, 102 and 106 are shipped and 103 is delivered.order_items (9 rows), worth 1080.44 in total.sales: the view from Part 4, with one row per order line and its category, status and amount.Every question with a query was run on PostgreSQL 17 to confirm its answer. Aim for at least 18 out of 26 before starting Part 5.
Quiz path: step 3. Take the quizzes in this order, after reading each article.
Previous quiz: Joins and Set Operations Review (SQL Part 3)
Next quiz: Subqueries and CTEs Review (SQL Part 5)
26 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.