Normalize the layers where data arrives and is integrated; denormalize the layer analysts query. Staging and the integration core stay close to third normal form so each fact is stored exactly once and corrections are cheap, while the presentation layer is denormalized into star schemas so business queries stay fast and consistent.
Summary: the short version
- Normalization removes redundancy so each fact is stored once. It prevents update, insert and delete anomalies.
- Denormalization reintroduces redundancy on purpose, to make reads faster and queries simpler to write.
- A warehouse needs both: 3NF or Data Vault in the integration core, star schemas in the presentation layer.
- The real cost of denormalization is not storage. It is restatement, dimension history and fact-to-fact joins.
- Columnar warehouses make wide tables cheap, which weakens the performance case for normalizing but not the correctness case.
- Do not build a star schema before you can finish the sentence "one row per ___".
Why does this question keep coming up?
Because most teams inherit the argument rather than choose a side. Someone built the warehouse normalized, because that is what they learned for transactional systems. Analysts complained about eight-table joins. Someone else flattened everything into one wide table that nobody can restate when a figure turns out to be wrong.
Both camps are half right. The resolution is not a compromise in the middle; it is putting each form in the layer where it belongs. This tutorial works through both transformations on the same dataset, in SQL, so you can see what each one costs.
What is normalization, and what problem does it solve?
Normalization is the process of splitting data into tables so that each fact is stored exactly once, with no repeating groups and no column depending on anything other than the whole primary key. It exists to prevent update, insert and delete anomalies. The normal forms come from Edgar Codd's 1970 paper, which introduced both n-ary relations and a normal form for database relations.
Here is the table every tutorial starts with. It is worth understanding exactly why it is broken.
-- orders_raw: one row per order, line items spread across repeating columns
CREATE TABLE orders_raw (
order_id INT,
order_date DATE,
customer_name VARCHAR(120),
customer_city VARCHAR(60),
customer_state VARCHAR(60),
product_1 VARCHAR(120),
qty_1 INT,
price_1 DECIMAL(10,2),
product_2 VARCHAR(120),
qty_2 INT,
price_2 DECIMAL(10,2)
);| Anomaly | What goes wrong in this table |
|---|---|
| Update | A customer moves from Pune to Mumbai. You must update every order row they appear in. Miss one and the warehouse disagrees with itself. |
| Insert | You cannot record a new product until somebody orders it, because product data exists only inside an order row. |
| Delete | Delete the only order containing a product and the product disappears from your records entirely. |
Note also that the table holds only two line items. An order with three products does not fit, and the usual fix (adding product_3) is how these tables reach forty columns.
How do you normalize a table to third normal form?
Each normal form removes one specific kind of dependency, so work through them in order. Skipping to 3NF without understanding what each step removed is how people end up unable to explain their own schema.
Step 1: first normal form: atomic values, no repeating groups
1NF requires that each column holds a single value and that there are no repeating groups of columns. The repeating product_n columns have to become rows.
-- 1NF: one row per order line instead of repeating columns
CREATE TABLE order_lines_1nf AS
SELECT order_id, order_date, customer_name, customer_city, customer_state,
product_1 AS product_name, qty_1 AS quantity, price_1 AS unit_price
FROM orders_raw
WHERE product_1 IS NOT NULL
UNION ALL
SELECT order_id, order_date, customer_name, customer_city, customer_state,
product_2, qty_2, price_2
FROM orders_raw
WHERE product_2 IS NOT NULL;The primary key is now the composite (order_id, product_name), and an order can hold any number of lines. The table is still highly redundant: the order date and the full customer address repeat on every line.
Step 2: second normal form: no partial dependencies
2NF requires that every non-key column depends on the whole composite key, not just part of it. Here order_date and the customer columns depend on order_id alone, which is half the key. That is a partial dependency, so those columns move to their own table.
-- 2NF: split order-level attributes away from line-level attributes
CREATE TABLE orders_2nf AS
SELECT DISTINCT order_id, order_date, customer_name, customer_city, customer_state
FROM order_lines_1nf;
CREATE TABLE order_lines_2nf AS
SELECT order_id, product_name, quantity, unit_price
FROM order_lines_1nf;Step 3: third normal form: no transitive dependencies
3NF requires that no non-key column depends on another non-key column. In orders_2nf, customer_city does not really depend on the order; it depends on the customer, who happens to be named on the order. That is a transitive dependency, and customers get their own table.
-- 3NF: four tables, each fact stored exactly once
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(120),
city VARCHAR(60),
state VARCHAR(60)
);
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(120),
category VARCHAR(60)
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
order_date DATE,
customer_id INT REFERENCES customers (customer_id)
);
CREATE TABLE order_lines (
order_id INT REFERENCES orders (order_id),
product_id INT REFERENCES products (product_id),
quantity INT,
unit_price DECIMAL(10,2),
PRIMARY KEY (order_id, product_id)
);The customer's city is now stored once. Correcting it is a single-row update, and every report built on this schema immediately agrees. That is the entire value proposition of normalization, and it is a real one.
Beyond 3NF there is Boyce-Codd normal form, which tightens 3NF for tables with overlapping candidate keys. In warehouse work 3NF is almost always the stopping point. Going further is a modelling exercise with little practical payoff.
What is denormalization, and what is a star schema?
Denormalization is deliberately reintroducing redundancy to make reads faster and queries simpler. In a warehouse it almost always means building a star schema: one fact table of measurements surrounded by dimension tables of descriptive context.
Star schemas consist of fact tables linked to dimension tables through primary and foreign key relationships, and they are the standard output of Kimball dimensional modelling, the set of techniques drawn from The Data Warehouse Toolkit.
The key move is flattening hierarchies. In 3NF you would store product, sub-category and category in three tables. In a dimension you store all three as columns on one row, accepting that "Electronics" is repeated thousands of times.
How do you build the star schema from 3NF tables?
Starting from the four 3NF tables above, the dimensional version adds surrogate keys, flattened hierarchies and validity columns. Those last two do work the 3NF schema cannot do at all.
-- Dimensions: flattened hierarchies, surrogate keys, history tracking
CREATE TABLE dim_customer (
customer_key BIGINT PRIMARY KEY, -- surrogate key, meaningless by design
customer_id INT, -- natural key from the source system
customer_name VARCHAR(120),
city VARCHAR(60),
state VARCHAR(60),
region VARCHAR(60), -- hierarchy flattened into columns
valid_from DATE,
valid_to DATE,
is_current BOOLEAN -- slowly changing dimension, type 2
);
CREATE TABLE dim_product (
product_key BIGINT PRIMARY KEY,
product_id INT,
product_name VARCHAR(120),
sub_category VARCHAR(60),
category VARCHAR(60),
brand VARCHAR(60)
);
CREATE TABLE dim_date (
date_key INT PRIMARY KEY, -- e.g. 20261123
full_date DATE,
month_name VARCHAR(12),
quarter VARCHAR(2),
fiscal_year INT,
is_weekend BOOLEAN
);
-- Fact: one row per order line, the grain stated once and never varied
CREATE TABLE fact_order_line (
date_key INT REFERENCES dim_date (date_key),
customer_key BIGINT REFERENCES dim_customer (customer_key),
product_key BIGINT REFERENCES dim_product (product_key),
order_id INT, -- degenerate dimension
quantity INT,
gross_amount DECIMAL(12,2),
discount_amount DECIMAL(12,2),
net_amount DECIMAL(12,2)
);Three things in that schema deserve naming, because they are the parts people leave out and then wonder why the warehouse misbehaves.
- Surrogate keys.
customer_keyis generated by the warehouse and carries no business meaning, so it survives a source system renumbering its customers. - Type 2 history. When a customer moves city you insert a new dimension row rather than updating the old one, so last year's revenue by state stays correct.
- A stated grain. One row per order line. Every measure in the table must be true at that grain.
Mixing grains in one fact table. Putting order-level shipping charges on an order-line fact table means every query that sums shipping multiplies it by the number of lines. If a measure is not true at the stated grain, it belongs in a different fact table.
What you actually gain
-- 3NF: revenue by state and month needs three joins and a derived measure
SELECT c.state,
DATE_TRUNC('month', o.order_date) AS month,
SUM(ol.quantity * ol.unit_price) AS revenue
FROM order_lines ol
JOIN orders o ON o.order_id = ol.order_id
JOIN customers c ON c.customer_id = o.customer_id
GROUP BY 1, 2;
-- Star: two joins, measure already computed, no business logic in the query
SELECT dc.state,
dd.month_name,
SUM(f.net_amount) AS revenue
FROM fact_order_line f
JOIN dim_customer dc ON dc.customer_key = f.customer_key
JOIN dim_date dd ON dd.date_key = f.date_key
GROUP BY 1, 2;The join count is the least interesting difference. Look at quantity * unit_price: that is business logic sitting in a query. Every analyst who writes it slightly differently (before or after discount, with or without tax) produces a different revenue number. Moving that calculation into net_amount once, in the pipeline, is most of what a presentation layer is for.
Which layer should be normalized, and which denormalized?
Both, in order. The argument only looks like a contradiction when you treat the warehouse as one thing rather than a sequence of layers with different jobs.
| Layer | Modelling style | Why it is that way |
|---|---|---|
| Raw / landing | None: source shape, append-only | Lets you replay history without re-extracting from the source |
| Staging | Lightly cleaned, still source-shaped | Typing, deduplication, basic validation |
| Integration / core | 3NF or Data Vault | One copy of each fact; survives source systems changing underneath you |
| Presentation / marts | Star schemas | Fast, understandable queries; consistent measure definitions |
This is also the real content of the old Inmon-versus-Kimball argument. Bill Inmon's corporate information factory puts a normalized enterprise warehouse at the centre and builds dimensional marts from it. Ralph Kimball's approach builds conformed dimensional models directly and ties them together with a bus architecture.
Where column stores change the calculation
On a columnar warehouse (BigQuery, Snowflake, Redshift), a wide denormalized table is cheaper than people trained on row stores expect, because unreferenced columns are never read and repeated values compress well.
Google's BigQuery documentation makes denormalization an explicit best practice, on the grounds that it localises data to individual slots so execution can happen in parallel. But it recommends nested and repeated fields rather than fully flattening, which preserves one-to-many relationships inline where the data is hierarchical and queried together.
What does denormalization actually cost?
Storage is the cost people quote and the one that matters least. Three costs matter more.
Restatement
A denormalized table bakes business logic into stored values. When the definition of net revenue changes, or a source system corrects six months of history, you rebuild the table. If the logic lives only in the pipeline and the pipeline is not reproducible, that rebuild is a project rather than a job run.
Dimension maintenance
Type 2 history means every attribute change inserts rows, and somebody has to decide, per column, whether a change should create history or simply overwrite. That decision is a business question which arrives as a technical ticket.
Fact-to-fact joins
This one bites hardest. Joining two fact tables at different grains (order lines to shipments on order_id, say) multiplies rows and silently inflates every SUM in the query. The dimensional answer is not a cleverer join. It is to aggregate each fact table separately and combine the results on conformed dimensions, which Kimball's own technique list calls multipass SQL to avoid fact-to-fact table joins.
If a query joins two tables that both contain measures, stop and check the row count before you trust the total. An inflated SUM looks exactly like a good quarter.
When should you not do either?
Both forms are over-applied, in opposite directions. Four cases where the honest answer is to stop.
Do not normalize the presentation layer
If analysts and BI tools query 3NF tables directly, you are paying in join complexity and inconsistent measures for an integrity benefit that only matters where data is written. Nothing writes to a warehouse the way an application writes to a transactional database.
Do not denormalize before you know the grain
A star schema is a commitment to a specific grain and a specific set of measures. If the business cannot yet tell you what it measures, building marts produces tables that get abandoned. Model the core, let people query it awkwardly for a quarter, and build marts for the questions that actually recur.
Do not flatten a star schema further out of habit
BigQuery's own documentation notes that star schemas are typically already optimised for analytics, and that denormalising further may not change performance significantly. One Big Table is a real pattern, but it should follow a measurement, not a preference.
Do not normalize small reference data
A forty-row country list split across three tables for purity's sake costs you joins and buys nothing. Normal forms are a tool for managing update anomalies, and a table nobody updates has none.
What should you do next?
Work out which layer your problem is actually in before you change any schema. If analysts complain about joins, the presentation layer is missing. If numbers disagree between reports, the integration layer is missing or measures are defined in queries instead of pipelines.
- Write the grain statement before any DDL: "one row per ___". If you cannot finish that sentence, you are not ready to build a fact table.
- Keep the integration core normalized, and make every correction a single-row update.
- Build one star schema for the most-asked question rather than a full set of marts.
- Move every derived measure out of analyst queries and into the fact table.
- Decide per dimension column whether a change creates history or overwrites, and write it down.
- Check row counts before trusting any total from a query that joins two fact tables.
- Measure whether two analysts now get the same revenue figure. That is the actual test.
If the wider question is which data and analytics capabilities your organisation should build first, our AI for Leaders and CXOs workshop helps leadership teams rank use cases by value, feasibility and risk.
Frequently asked questions
Should a data warehouse be normalized or denormalized?
Both, in different layers. The integration core is normalized so each fact is stored once and corrections are cheap; the presentation layer is denormalized into star schemas so analysts get fast queries and consistent measures. Treating the warehouse as a single modelling decision is what makes this look like a contradiction.
Is a star schema denormalized?
Yes. Dimension tables flatten hierarchies that a normalized design would split across several tables, so product, sub-category and category become three columns on one dimension row. Fact tables stay narrow and additive; the denormalization is in the dimensions.
What is the difference between a star schema and a snowflake schema?
A star schema keeps each dimension as a single flat table. A snowflake schema normalizes the dimension hierarchies into separate tables, so category becomes its own table joined to product. Snowflaking saves a little storage and costs query simplicity, which is usually the wrong trade in a presentation layer.
Does normalization still matter on modern cloud warehouses?
Yes, in the integration layer. Columnar storage and cheap compute make wide tables more affordable than they were on row stores, which weakens the performance argument for normalizing. It does not weaken the correctness argument: storing a fact once is what makes a correction a one-row update instead of a backfill.
What is 3NF in simple terms?
A table is in third normal form when every column depends on the key, the whole key and nothing but the key. In practice that means no repeating groups of columns, no column that depends on only part of a composite key, and no column that depends on another non-key column.
Which normal form should a data warehouse core use?
Third normal form is the usual stopping point, and it is what Inmon-style enterprise warehouses use. Some teams use Data Vault instead, which splits data into hubs, links and satellites to handle changing sources and auditability. Boyce-Codd and higher normal forms rarely earn their complexity in warehouse work.
Sources
- Codd, E. F. "A Relational Model of Data for Large Shared Data Banks." Communications of the ACM, 13(6), 377–387. 1970. https://doi.org/10.1145/362384.362685
- Kimball Group. "Dimensional Modeling Techniques." https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling/
- Google Cloud. "Use nested and repeated fields" (BigQuery documentation). https://docs.cloud.google.com/bigquery/docs/best-practices-performance-nested

By