How do you join tables on overlapping date ranges using range join conditions?
Asked in the Technical stage. Using the supplied tables, write a query that returns every pair of records whose inclusive date ranges overlap.
source_period_id, target_period_id, overlap_start, and overlap_endsource_period_id, then target_period_id| Column | Type | Description |
|---|---|---|
| period_idPK | INT | Unique identifier for the source date range |
| period_label | VARCHAR(30) | Source range label |
| start_date | DATE | Inclusive start date of the source range |
| end_date | DATE | Inclusive end date of the source range |
| Column | Type | Description |
|---|---|---|
| period_idPK | INT | Unique identifier for the target date range |
| period_label | VARCHAR(30) | Target range label |
| start_date | DATE | Inclusive start date of the target range |
| end_date | DATE | Inclusive end date of the target range |