

You are given a table of NVIDIA GPU order transactions and asked to use SQL to analyze business performance. Write a query that returns total revenue by month for completed orders only. The result should show the month in YYYY-MM format and the summed revenue for that month, ordered from highest revenue to lowest.
gpu_orders
| column | type | description |
|---|---|---|
| order_id | INT | Unique order identifier |
| customer_name | VARCHAR(100) | Customer name |
| product_line | VARCHAR(50) | NVIDIA product line |
| order_date | DATE | Date the order was placed |
| order_status | VARCHAR(20) | Order status |
| revenue | DECIMAL(10,2) | Revenue from the order |
| order_id | customer_name | product_line | order_date | order_status | revenue |
|---|---|---|---|---|---|
| 3 | Vertex AI Labs | GeForce | 2024-02-01 | completed | 1800.00 |
| 5 | Aurora Vision | RTX PRO | 2024-01-20 | cancelled | 900.00 |
| 8 | Helios Systems | GeForce | 2024-03-03 | completed | 0.00 |
| 10 | Nova Robotics | RTX PRO | 2024-02-18 | completed | 2200.00 |
| order_month | total_revenue |
|---|---|
| 2024-02 | 5200.00 |
| 2024-01 | 4500.00 |
| 2024-03 | 1500.00 |
You are given a table of NVIDIA GPU order transactions and asked to use SQL to analyze business performance. Write a query that returns total revenue by month for completed orders only. The result should show the month in YYYY-MM format and the summed revenue for that month, ordered from highest revenue to lowest.
gpu_orders
| column | type | description |
|---|---|---|
| order_id | INT | Unique order identifier |
| customer_name | VARCHAR(100) | Customer name |
| product_line | VARCHAR(50) | NVIDIA product line |
| order_date | DATE | Date the order was placed |
| order_status | VARCHAR(20) | Order status |
| revenue | DECIMAL(10,2) | Revenue from the order |
| order_id | customer_name | product_line | order_date | order_status | revenue |
|---|---|---|---|---|---|
| 3 | Vertex AI Labs | GeForce | 2024-02-01 | completed | 1800.00 |
| 5 | Aurora Vision | RTX PRO | 2024-01-20 | cancelled | 900.00 |
| 8 | Helios Systems | GeForce | 2024-03-03 | completed | 0.00 |
| 10 | Nova Robotics | RTX PRO | 2024-02-18 | completed | 2200.00 |
| order_month | total_revenue |
|---|---|
| 2024-02 | 5200.00 |
| 2024-01 | 4500.00 |
| 2024-03 | 1500.00 |