Loading…
Loading…
Twenty-five questions on pivoting and unpivoting, buckets and percentages, running shares, top-N and extreme values, as-of lookups, hierarchical queries and classic tricky problems such as relational division, with explanations.
Review quiz for Part 9 (Reporting and advanced queries) of the SQL course:
The questions use the shop database from Part 3 and the sales view, which has one row per order line with its order_id, placed_on, status, category, brand, qty and amount:
products (7 rows): Ridge 2 tent 249.99 and Summit 4 tent 489.00 (tents), Glow head torch 34.50 and Basecamp lantern 27.00 (lighting), Trail 30 backpack 89.95 and Day 18 backpack 54.00 (packs), Merino socks 16.00 (clothing).orders (6 rows): 101 and 103 by Asha, 102 by Ben, 104 by Chen, 105 by Dana (cancelled), and the guest order 106.order_items (9 rows): order 101 has products 1 and 7, 102 has 3, 103 has 5, 3 and 7, 104 has 2, 105 has 6, and 106 has 7.Every question with a query was run on PostgreSQL 17 to confirm its answer. Aim for at least 18 out of 25 before starting Part 10.
Quiz path: step 8. Take the quizzes in this order, after reading each article.
Previous quiz: Data Types and Functions Review (SQL Part 8)
Next quiz: Database Design and Defining Tables Review (SQL Parts 10 and 11)
25 questions · pass at 70%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.