Loading…
Loading…
Twenty-seven questions on window functions: OVER and PARTITION BY, ROW_NUMBER, RANK, DENSE_RANK and NTILE, top-N per group and ties, frames with ROWS, RANGE and GROUPS, LAG, LEAD, FIRST_VALUE and LAST_VALUE, and gaps-and-islands patterns, with explanations.
Review quiz for Part 6 (Window functions) of the SQL course:
The questions use these tables from Part 6:
products (7 rows): clothing: Merino socks 16.00; lighting: Basecamp lantern 27.00 and Glow head torch 34.50; packs: Day 18 backpack 54.00 and Trail 30 backpack 89.95; tents: Ridge 2 tent 249.99 and Summit 4 tent 489.00.units_sold, a view with the units sold per product: Merino socks 6, Glow head torch 3, the two backpacks and the two tents 1 each, and the Basecamp lantern 0.daily_sales(day, amount): 1 March 120.00, 2 March 80.00, 3 March 150.00, 5 March 60.00, 6 March 200.00, 7 March 90.00 and 8 March 110.00. There's no row for 4 March.Every question with a query was run on PostgreSQL 17 to confirm its answer. Aim for at least 19 out of 27 before starting Part 7.
Quiz path: step 5. Take the quizzes in this order, after reading each article.
Previous quiz: Subqueries and CTEs Review (SQL Part 5)
Next quiz: Changing Data Review (SQL Part 7)
27 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.