Bought Every Show in a Genre
Hard About 25 min Katabench Pro
Relational division: find the rows that match every member of a set, not just one of them.
The full brief is part of Katabench Pro
Pro opens this kata's brief, its starter code and its grader. To see how the track works first, try Customer Order Totals, which is free.
How it is graded
Your LINQ or SQL runs against real PostgreSQL. You see the SQL your code generates on the sample tests and can inspect its execution plan, so you learn when the database did the wrong work.
What it practices
- Relational division
- Find rows related to every member of a set, not just some of them.
Related katas
- The Whole Catalog, Not Just Several Products Hard Pro Use relational division to find customers who bought every product in a requested category.
- Whose Basket Is a Proper Subset? Hard Pro Compare dynamic distinct purchase sets with nested existence checks and return every proper customer-set containment relation.
- The Same Basket in Different Lines Hard Pro Compare order baskets as product-to-total-quantity multisets, independent of line splitting, prices, totals, and row order.
- Every Anchor Buyer Also Bought This Hard Pro Use relational division to find products shared by every buyer of a dynamic anchor product.