D8LooPFocus modeCODE WORKSPACE
Detect changed dimension rows and compute close/open validity boundaries.
The SQL API will hydrate this workspace with the exercise-specific starter query and schema.
Sample input
| customer_id | tier | valid_from | valid_to | is_current |
|---|---|---|---|---|
| 101 | silver | 2025-01-01 | 9999-12-31 | 1 |
| 104 | gold | 2026-02-20 | 9999-12-31 | 1 |
| 105 | bronze | 2025-12-01 | 9999-12-31 | 1 |
| customer_id | tier | updated_at |
|---|---|---|
| 101 | gold | 2026-03-05 10:00:00 |
| 104 | platinum | 2026-03-05 12:30:00 |
| 105 | bronze | 2026-03-05 08:00:00 |
Expected output
| customer_id | old_tier | new_tier | old_valid_from | old_valid_to | new_valid_from | new_valid_to |
|---|---|---|---|---|---|---|
| 101 | silver | gold | 2025-01-01 | 2026-03-04 | 2026-03-05 | 9999-12-31 |
| 104 | gold | platinum | 2026-02-20 | 2026-03-04 | 2026-03-05 | 9999-12-31 |
Constraints
Load the live SQL exercise to inspect the full prompt, schema, starter query, and expected output.
Expected skills
SCD2, History, Validity windows
Run the SQL query to inspect preview rows.