Given a table of historical port arrivals, how would you calculate the average transit time between two specific ports over the last quarter at Mediterranean Shipping?
Use the historical_port_arrivals table and calculate transit time from departure_at to arrival_at. Include only completed trips between Valencia and Genoa during the previous calendar quarter.
origin_port, destination_port, and average_transit_hours.| Column | Type | Description |
|---|---|---|
| arrival_idPK | INT | Unique historical arrival record identifier |
| vessel_name | VARCHAR(100) | Name of the vessel completing the voyage |
| origin_port | VARCHAR(100) | Port from which the voyage departed |
| destination_port | VARCHAR(100) | Port at which the vessel arrived |
| departure_at | TIMESTAMP | Departure timestamp from the origin port |
| arrival_at | TIMESTAMP | Arrival timestamp at the destination port |