Explain how you implement SCD 2 and write a query to verify the history is correct.
Assume the dimension table stores one row per version of an entity, with current and historical records side by side. Your answer should describe the SCD 2 loading approach and provide a SQL query that checks the version history for correctness.
| Column | Type | Description |
|---|---|---|
| customer_skPK | BIGINT | Surrogate key for the dimension row |
| customer_id | VARCHAR(50) | Business key for the customer |
| customer_name | VARCHAR(200) | Customer name for the version |
| city | VARCHAR(100) | Customer city for the version |
| effective_from | DATE | Start date for this version |
| effective_to | DATE | End date for this version, null for current row |
| is_current | BOOLEAN | True for the active version |