August 2017
Beginner to intermediate
426 pages
9h 36m
English
As you can see in the following table, we are maintaining the full history by adding new records to maintain the history of the previous records:
|
PM_PRIMARYKEY |
EMPLOYEE_ID |
NAME |
LOCATION |
PM_BEGIN_DATE |
PM_END_DATE |
|
100 |
1001 |
STEVE |
INDIA |
01-01-14 |
31-05-14 |
|
101 |
1001 |
STEVE |
USA |
01-06-14 |
99-99-9999 |
We add three new columns in the table: PM_PRIMARYKEY to handle the issues of duplicate records in the primary key in the EMPLOYEE_ID column, and PM_BEGIN_DATE and PM_END_DATE to understand the versions in the data.
The advantage of SCD2 is that you have complete history of the data, which is a must for data warehouse.
The disadvantage of SCD2 is that it consumes a lot of space.
Read now
Unlock full access