Your question is Top-N Products With Window Functions. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
DICK'S Sporting Goods wants a quick view of its strongest recent product sales. Using the product_sales table, write a PostgreSQL query that finds the three products with the highest total units sold during the inclusive 30-day period from January 17, 2025 through February 15, 2025.
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| product_name | VARCHAR(100) | Product sold through DICK'S Sporting Goods |
| category | VARCHAR(50) | Product category |
| sale_date | DATE | Date on which the sale occurred |
| units_sold | INT | Number of units sold |