eCommerce Graded Drills (Easy → Hard)
These drills build practical eCommerce analytics skills with increasing complexity.
Scoring suggestion:
- pass all easy drills
- pass at least one medium drill
- pass at least one hard drill before capstone
Easy 1: Completed Orders by Country #
Loading SQL editor...
Easy 2: Orders and Revenue by Product Category #
Loading SQL editor...
Medium 1: Monthly Net Revenue #
Attribution rule: returns are attributed to the month of the original order (the order's order_date), not the month the return happened. Both CTEs below bucket by the order month so revenue and returns line up.
Loading SQL editor...
Medium 2: Customer Return Ratio #
Loading SQL editor...
Hard 1: Top 3 Customers by Net Revenue per Month #
Loading SQL editor...
Hard 2: Category-Level Kept-Revenue Share #
kept_revenue_share = net_sales / gross_sales, the share of gross sales the business keeps after refunds (equal to 1 minus the return rate). It is not a margin: this dataset has no cost data.
Loading SQL editor...
Tip
When metrics combine orders, items, and returns, aggregate each source to the target grain first, then join.