0% found this document useful (0 votes)
24 views10 pages

2 5+-+Slowly+Changing+Dimensions

The document discusses Slowly Changing Dimensions (SCD), a data management concept that addresses how tables manage data changes over time. It outlines three types of SCD: Type 0 (no changes allowed), Type 1 (overwrite without history), and Type 2 (retains full history by adding new rows). Additionally, it contrasts SCD Type 2 with Delta Time Travel, noting that the latter is not a long-term versioning solution.

Uploaded by

hiepghast23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views10 pages

2 5+-+Slowly+Changing+Dimensions

The document discusses Slowly Changing Dimensions (SCD), a data management concept that addresses how tables manage data changes over time. It outlines three types of SCD: Type 0 (no changes allowed), Type 1 (overwrite without history), and Type 2 (retains full history by adding new rows). Additionally, it contrasts SCD Type 2 with Delta Time Travel, noting that the latter is not a long-term versioning solution.

Uploaded by

hiepghast23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Slowly Changing

Dimensions
Learning Objectives

u Slowly Changing Dimensions (SCD)

u SCD Types

u SCD vs. Delta Time Travel


Slowly Changing Dimensions

u Slowly Changing Dimensions (SCD)

u Data management concept that determines how tables handle


data which change over time

u Whether you want to overwrite values or retain their history


SCD Types

u Type 0: No changes allowed


u Static/Append only

u Type 1: Overwrite
u No history retained (use Delta Time Travel if needed)

u Type 2: Add new row for each change and mark the old as obsolete
u Retains the full history of values.
SCD Type 1

Product ID Product Name Price


1 Product A 10
2 Product B 20
3 Product C 30
SCD Type 1

Product ID Product Name Price


1 Product A 50
2 Product B 20
3 Product C 70
SCD Type 2

Product ID Product Name Price Current Effective Date End Date


1 Product A 10 True 2023-01-01 NULL
2 Product B 20 True 2023-01-01 NULL
3 Product C 30 True 2023-01-01 NULL
SCD Type 2

Product ID Product Name Price Current Effective Date End Date


1 Product A 10 False 2023-01-01 2023-02-25
2 Product B 20 True 2023-01-01 NULL
3 Product C 30 False 2023-01-01 2023-02-28
1 Product A 50 True 2023-02-25 NULL
3 Product C 70 True 2023-02-28 NULL
SCD Type 2

Product ID Product Name Price Current Effective Date End Date


1 Product A 10 False 2023-01-01 2023-02-25
2 Product B 20 True 2023-01-01 NULL
3 Product C 30 False 2023-01-01 2023-02-28
1 Product A 50 True 2023-02-25 NULL
3 Product C 70 True 2023-02-28 NULL
SCD Type 2 vs. Delta Time Travel

u Can we use Delta Time Travel as SCD Type 2 ?

u Delta Time Travel is not a long-term versioning solution

You might also like