Your question is Calculate Monthly Sales Growth by Product Category. Start with the requirements and the two tables 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.
A retail company needs to analyze its sales performance. Write a SQL query to calculate the month-over-month sales growth for each product category.
sales and products tables by product_id.| Column | Type | Description |
|---|---|---|
| idPK | INT | Primary key |
| product_id | INT | Foreign key referencing products |
| sale_date | DATE | Date of the sale |
| amount | DECIMAL | Sale amount |
| Column | Type | Description |
|---|---|---|
| idPK | INT | Primary key |
| category | VARCHAR(255) | Product category |