Home › Interview Questions › Explain how to handle slowly changing dimensions (…

Explain how to handle slowly changing dimensions (SCD) in a data warehouse, and illustrate with an example where record 101 is new, record 2021 is new, and record 102 changed from Plan B to Plan D.

🟡 Medium Conceptual Junior level
1Times asked
Nov 2026Last seen
Nov 2026First seen

💡 Model Answer

Slowly Changing Dimensions (SCD) are a common challenge in data warehousing where dimension attributes evolve over time. The output you described – record 101 appearing as new, record 2021 also new, and record 102 changing from Plan B to Plan D – illustrates the three classic SCD scenarios. In an SCD‑Type 1 approach, you simply overwrite the old value with the new one, losing history. In SCD‑Type 2 you preserve history by adding a new row with a new surrogate key and effective dates, marking the old row as inactive. For the example, you would insert a new row for 101 and 2021, and for 102 you would insert a new row with Plan D while setting the previous row’s end date. SCD‑Type 3 stores a limited number of previous values in the same row, which is less common for attributes that change frequently. Detecting changes typically involves a hash or checksum of the dimension columns; if the hash differs between the source and target, you know a change has occurred. Once a change is detected, you apply the chosen SCD strategy to update the warehouse. Proper handling of SCD ensures accurate historical reporting and auditability.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500