Your question is Top Shippers by Volume. Start with the requirements and the two 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 Business Intelligence team needs a quarterly view of shipper volume. Write a PostgreSQL query that returns the top three shippers by completed freight weight during the previous calendar quarter. For the sample data, assume the query runs on August 29, 2026, making April 1 through June 30, 2026 the previous quarter.
shippers to loads using shipper_id.pickup_date falls in the previous calendar quarter.weight_lbs for each shipper, return the top three, and break ties by shipper_id ascending.| Column | Type | Description |
|---|---|---|
| shipper_idPK | INTEGER | Unique shipper identifier |
| shipper_name | VARCHAR(100) | Shipper company name |
| Column | Type | Description |
|---|---|---|
| load_idPK | INTEGER | Unique load identifier |
| shipper_id | INTEGER | References shippers.shipper_id |
| pickup_date | DATE | Scheduled pickup date |
| status | VARCHAR(20) | Operational load status |
| weight_lbs | NUMERIC(12,2) | Freight weight in pounds |