Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Understanding SCD — Slowly Changing Dimensions
Data Engineering   Data Science   Data Visualization   Latest   Machine Learning

Understanding SCD — Slowly Changing Dimensions

Last Updated on November 5, 2023 by Editorial Team

Author(s): Saniya Parveez

Originally published on Towards AI.

Introduction

In the dynamic realm of data management, the concept of Slowly Changing Dimensions (SCD) emerges as a crucial paradigm. SCD constitutes a fundamental principle in the field of data warehousing and database administration, meticulously designed to proficiently navigate the nuances of changing data over time. It offers a structured approach to gracefully accommodate shifts in information, ensuring that the historical context remains intact while seamlessly integrating updates. Mastery of SCD is imperative for upholding data precision, empowering comprehensive trend analysis, and facilitating astute decision-making in the sphere of data-driven insights. This introduction embarks on a journey through the critical elements of SCD, unveiling its diverse classifications and illuminating its indispensable role in the modern landscape of data management.

Slowly Changing Dimensions(SCD)

It deals with how to manage data that changes over time. In data warehouses, information isn’t always fixed; it can change, and handling these changes effectively is essential for accurate analysis and reporting. In data warehousing, dimensions refer to the descriptive attributes of data, providing context and meaning. These dimensions often evolve over time due to various factors like customer information updates, product details modifications, or geographical reclassifications.\

The Kimball Approach

Kimball proposes 3 solutions and names them ‘Type 1’, ‘Type 2’, & ‘Type 3’.

Type 1: Overwrite

In this approach, when a change occurs, the existing record is simply updated with the new information. This means that the old data is overwritten, and there’s no historical record of the change.

Example of a customer table:

If the customer relocates the headquarters to Illinois, the record will be overwritten:

The disadvantage of the Type 1 method is that there is no history in the data warehouse. It has the advantage, however, that it’s easy to maintain.

Type 2: add a new row

With Type 2, a new record is added to represent the updated information, while the old record is preserved. This allows for a historical track of changes, typically with a date range indicating the validity of each version.

For example, if the customer relocates to Illinois the version numbers will be incremented sequentially:

Another method is to add date columns

The null end_date in row two indicates the current tuple version

Type 3: add new attribute

Type 3 maintains both old and new values for selected attributes, usually in separate columns. This approach provides limited historical data but can be efficient for specific types of queries. In the following example, an additional column has been added to the table to record the customer’s original state — only the previous history is stored.

This record contains a column for the original state and current state — it cannot track the changes if the customer relocates a second time.

Conclusion

Slowly Changing Dimensions (SCD) stand as a cornerstone in the realm of data management, particularly within data warehousing and database administration. SCD ensures that historical context is preserved while accommodating changes over time. The three main types of SCD — Type 1, Type 2, and Type 3 — offer distinct approaches to managing data transformations, each tailored to specific scenarios. In essence, a proficient understanding and application of SCD empowers organizations to glean meaningful insights from their data, thereby enabling informed decision-making and contributing to the overall effectiveness of data-driven operations.

References

The Data Warehouse Toolkit by Ralph Kimball

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓