Your question is Top Customers Excluding Segments. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Convoy's shipper analytics team needs a customer-level view of delivered load volume. Write a PostgreSQL query to identify the top five customers after excluding loads hauled by specified carrier segments.
load_volume.owner_operator or small_fleet segments. Treat a NULL carrier segment as eligible.customer_name ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer business name |
| Column | Type | Description |
|---|---|---|
| load_idPK | INT | Unique load identifier |
| customer_id | INT | Customer associated with the load |
| carrier_id | INT | Carrier assigned to the load |
| status | VARCHAR(30) | Current load status |
| Column | Type | Description |
|---|---|---|
| carrier_idPK | INT | Unique carrier identifier |
| segment | VARCHAR(40) | Carrier classification segment |