Add a Column to Monthly Sales
MediumDescription
v_monthly_sales is a view with one row per month, counting only the orders that weren't
cancelled or returned. Replace it so that it also shows best_order: the largest total_amount
among those orders in the month, as a new last column. Everything else in the view must stay
as it is.
Then finish with exactly this query:
CodeSELECT month, orders_count, revenue, best_order FROM v_monthly_sales WHERE month >= DATE '2025-07-01' AND month < DATE '2025-11-01' ORDER BY month;
Tables
| v_monthly_sales |
|---|
| month |
| orders_count |
| revenue |
| avg_order_value |
| orders |
|---|
| order_id (PK) |
| customer_id (FK) |
| order_date |
| status |
| total_amount |
| shipping_city |