Write a query to identify top-performing vendors based on order history at Xometry.
Use completed Xometry orders to calculate each vendor's order count, total order value, and average order value. Return the three highest-ranked vendors, including all vendors tied at the third rank.
vendor_name, completed_order_count, total_completed_value, average_completed_value, and performance_rank.| Column | Type | Description |
|---|---|---|
| vendor_idPK | INT | Unique Xometry vendor identifier |
| vendor_name | VARCHAR(100) | Vendor display name |
| vendor_region | VARCHAR(50) | Vendor operating region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique Xometry order identifier |
| vendor_id | INT | Vendor assigned to fulfill the order |
| order_status | VARCHAR(20) | Current order status |
| order_value | NUMERIC(12,2) | Order value in US dollars |
| order_date | DATE | Date the order was placed |