Write a SQL query using window functions to rank users or sellers by performance.
For this exercise, rank all sellers by the total value of their completed orders. Include sellers with no completed orders, and assign the same rank to sellers with equal totals.
seller_id, seller_name, total_completed_gmv, and performance_ranktotal_completed_gmv descending, then seller_id ascending for ties| Column | Type | Description |
|---|---|---|
| seller_idPK | INT | Unique seller identifier |
| seller_name | VARCHAR(100) | Seller display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| seller_id | INT | Seller associated with the order |
| status | VARCHAR(30) | Current order status |
| order_value | NUMERIC(12,2) | Order merchandise value |