SCD Type 1

Type 1: Overwrite the Old Value

Type 1 updates the dimension row in place. It is simple and keeps one row per customer, but every past fact now reports the new value. Watch customer 1's 2025 sales move continents when she moves from Australia to the UK:

4101-type1.sql: a Type 1 overwrite rewrites history (rolled back)SQL
BEGIN;
CREATE TEMP VIEW cust1_2025 AS
SELECT c.country, c.region, sum(f.gross_amount) AS gross_2025
FROM mart.fact_sales f JOIN mart.dim_customer c USING (customer_key)
JOIN mart.dim_date d USING (date_key)
WHERE c.customer_id = 1 AND d.year = 2025 GROUP BY 1, 2;
TABLE cust1_2025;
UPDATE mart.dim_customer SET country = 'GB', region = 'Europe'   -- Type 1: overwrite
WHERE customer_id = 1;
TABLE cust1_2025;
ROLLBACK;
Output
 country |    region    | gross_2025
---------+--------------+------------
 AU      | Asia-Pacific |     427.88
 country | region | gross_2025
---------+--------+------------
 GB      | Europe |     427.88

Nothing about 2025 changed, yet a report rerun today credits Europe. Use Type 1 for corrections (a misspelled name, a wrong ISBN) and for attributes whose history nobody analyzes. Because the old value is gone, any aggregate or materialized view built on it (Views, Partitions, Parallelism) must be refreshed too.