101
0/304
Loading content...
A logistics analytics platform tracks inventory placement across multiple fulfillment facilities.
Table: warehouse
Table: products
Metric definition:
Task: Return the occupied inventory volume for each facility.
Output requirements:
Supported submission environments:
warehouse:
| name | product_id | units |
|-------------|------------|-------|
| NorthHub | 1 | 1 |
| NorthHub | 2 | 10 |
| NorthHub | 3 | 5 |
| SouthHub | 1 | 2 |
| SouthHub | 2 | 2 |
| OverflowHub | 4 | 1 |
products:
| product_id | product_name | width | length | height |
|------------|--------------|-------|--------|--------|
| 1 | Console-TV | 5 | 50 | 40 |
| 2 | KeyFob | 5 | 5 | 5 |
| 3 | PhoneBox | 2 | 10 | 10 |
| 4 | ApparelPack | 4 | 10 | 20 |[
{"warehouse_name":"NorthHub","volume":12250},
{"warehouse_name":"OverflowHub","volume":800},
{"warehouse_name":"SouthHub","volume":20250}
]Each row contributes units multiplied by product cubic size. Summing per facility yields 12250 for NorthHub, 20250 for SouthHub, and 800 for OverflowHub.
warehouse:
| name | product_id | units |
|------|------------|-------|
| (no rows) |
products:
| product_id | product_name | width | length | height |
|------------|--------------|-------|--------|--------|
| 10 | SparePart-A | 2 | 3 | 4 |
| 11 | SparePart-B | 5 | 6 | 7 |[]No warehouse rows means no facility has stored inventory, so the result is empty.
warehouse:
| name | product_id | units |
|-----------|------------|-------|
| East-01 | 10 | 3 |
| East-01 | 20 | 4 |
| West-Prime| 10 | 2 |
| West-Prime| 30 | 1 |
| Edge Lab | 40 | 5 |
products:
| product_id | product_name | width | length | height |
|------------|----------------|-------|--------|--------|
| 10 | Relay Module | 3 | 3 | 3 |
| 20 | Cooling Unit | 2 | 5 | 4 |
| 30 | Battery Crate | 10 | 2 | 2 |
| 40 | Medical Cooler | 1 | 8 | 6 |[
{"warehouse_name":"East-01","volume":241},
{"warehouse_name":"Edge Lab","volume":240},
{"warehouse_name":"West-Prime","volume":94}
]Per-row contributions are East-01: 327 + 440 = 241, West-Prime: 227 + 140 = 94, and Edge Lab: 5*48 = 240.
Constraints