Maersk operations teams need to identify the busiest ports in the January 2026 reporting period. Write a PostgreSQL query that uses a subquery to return the top two ports by total container volume, measured in TEU.
Requirements
- Join
port_calls, ports, and container_movements.
- Include only completed port calls between
2026-01-01 and 2026-01-31, inclusive.
- Aggregate TEU by port in an inner subquery.
- Return the top two ports, ordered by total TEU descending, with
port_code as a deterministic tie-breaker.