Given a table of vehicle availability intervals, write a query to find the continuous periods when a vehicle was unbooked.
Each row contains a vehicle, start and end timestamps, and a status. Treat overlapping or touching unbooked intervals as one continuous period. Ignore incomplete intervals and rows whose status is not unbooked.
vehicle_id, unbooked_start, unbooked_end, and duration_hours.vehicle_id, then unbooked_start.| Column | Type | Description |
|---|---|---|
| interval_idPK | INT | Unique interval identifier |
| vehicle_id | VARCHAR(20) | Vehicle identifier |
| interval_start | TIMESTAMP | Start timestamp of the availability interval |
| interval_end | TIMESTAMP | End timestamp of the availability interval |
| status | VARCHAR(20) | Interval status, such as unbooked or booked |