
Write a PostgreSQL query that joins Hertz rental transactions to Hertz location data and summarizes completed rental revenue by region. Keep transactions with missing location matches by grouping them under Unknown, and include a count of those unmatched transactions in the output.
| Column | Type | Description |
|---|---|---|
| transaction_id | ||
| reservation_code | ||
| pickup_location_id | ||
| rental_date | ||
| status | ||
| revenue_amount |
| Column | Type | Description |
|---|---|---|
| location_id | ||
| location_name | ||
| region |
One row per regionSum revenue only for `Completed` rentalsCount completed rentals per regionCount transactions with no matching locationSort by total revenue descending