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.
Requirements
- Join
shippers to loads using shipper_id.
- Include only completed loads whose
pickup_date falls in the previous calendar quarter.
- Sum
weight_lbs for each shipper, return the top three, and break ties by shipper_id ascending.