Etsy
Analytics Reporting Track · Hard · 35 min
Revenue Rank Within Category
Merchandising wants the top products by revenue inside each category. Return the top two products per category with category, product_name, total_revenue, an...
Company labels are directional practice context, not official interview guidance.
Objective
Practice query basics through a Etsy-tagged business scenario.
Approach
Use this track to train on SQL that mirrors day-to-day analytics workflows and recurring reporting asks.
Company context
Company labels are directional practice context, not official interview guidance.
Merchandising wants the top products by revenue inside each category. Return the top two products per category with category, product_name, total_revenue, and revenue_rank. Sort by category, revenue_rank, then product_name.
products
| product_id | category | |
|---|---|---|
| 1 | Home | Oak Tray |
| 2 | Home | Linen Runner |
| 3 | Jewelry | Silver Ring |
| 4 | Jewelry | Pearl Necklace |
| 5 | Jewelry | Charm Bracelet |
order_lines
| line_id | product_id | line_revenue | 2 |
|---|---|---|---|
| 101 | 1 | 120.00 | |
| 102 | 1 | 80.00 | |
| 103 | 2 | 150.00 | |
| 104 | 3 | 90.00 | |
| 105 | 3 | 60.00 | |
| 106 | 4 | 200.00 | |
| 107 | 5 | 110.00 |
SQL workspace
Run queries against the protected question data, then submit once the result shape looks right.
Sign in to run SQL
Create a free account or sign in before running queries against protected question data.