A retail analytics team wants to analyze monthly sales performance by product category. You are given two tables: sales records individual sales transactions, and products contains product details.
Write a SQL query to calculate the total sales amount for each product category and month.
sales and products to associate each sale with its category.YYYY-MM format).| Column | Type | Description |
|---|---|---|
| idPK | INT | Primary key for sales records |
| product_id | INT | Foreign key referencing products |
| sale_date | DATE | Date of the sale |
| amount | DECIMAL(10,2) | Sale amount |
| Column | Type | Description |
|---|---|---|
| idPK | INT | Primary key for product records |
| name | VARCHAR(255) | Name of the product |
| category | VARCHAR(255) | Category of the product |