Write a query to calculate the year-over-year growth of freight volume by region at Uber Freight.
Use the freight_shipments and regions tables. Compare each region's 2024 freight volume with its 2023 volume. Treat missing prior-year volume as NULL, and avoid division by zero.
region_name, current_year, current_volume, prior_volume, and yoy_growth_pctregion_name ascending| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(100) | Uber Freight operating region name |
| Column | Type | Description |
|---|---|---|
| shipment_idPK | INT | Unique shipment identifier |
| region_id | INT | Region associated with the shipment |
| shipment_date | DATE | Shipment date |
| freight_volume | NUMERIC(12,2) | Freight volume recorded for the shipment |