All tasks

Analysis of Car Rental Seasons (Gaps & Islands + Dynamic Pivot)

Master

Task: Analyze car rental data and determine "activity seasons" for each car. **Source tables:** - rentals (rental_id, car_id, fleet_id, city_id, driver_id, start_ts, end_ts, is_active) - fleets (fleet_id, fleet_name, city_id) - cities (city_id, city_name) - drivers (driver_id, driver_name, rating) **What to do:** 1. Merge overlapping or adjacent (≤1 day gap) rental intervals for each car+driver pair 2. Group the obtained pe

Category
Advanced Analytics
Estimated time
~60 min
Databases
PostgreSQLGreenplum
Tags
Gaps & IslandsDynamic PivotРекурсивный CTEОбъединение интерваловОконные функцииДинамический SQL

Sign in to solve

Start Solving