Your question is Monthly Sales Summary by Category. 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.
NovaCart wants a simple monthly sales summary from a single transactions table. Write a SQL query to aggregate completed sales for January 2024 by product category.
category, transaction_count, and total_sales for rows where status = 'completed' and transaction_date is in January 2024.category and order by total_sales descending.| Column | Type | Description |
|---|---|---|
| idPK | INT | Unique transaction identifier |
| category | VARCHAR(50) | Product category for the transaction |
| amount | DECIMAL(10,2) | Transaction amount |
| status | VARCHAR(20) | Transaction processing status |
| transaction_date | DATE | Date when the transaction occurred |
| sales_rep | VARCHAR(100) | Sales representative associated with the transaction |