Dimensional Modeling: Star Schema, Fact & Dimension Tables
Dimensional modeling is the data warehouse design technique that organizes data into fact tables
(measurable business events) and dimension tables (descriptive context). Popularized by Ralph
Kimball, it is optimized for analytical queries and business intelligence. This guide covers the
star schema, grain, measures, slowly changing dimensions, snowflake schema, factless fact tables,
and the 25 interview questions that actually come up — with deep, descriptive theory aligned to
the topic.
🎯 Key Takeaways
Dimensional modeling organizes data for analytics
Fact tables store measurable business events
Dimension tables provide descriptive context
Grain defines what one fact row represents
SCD handles changing dimension attributes
Star schema is the most common dimensional model
25 Interview QuestionsBeginner to AdvancedKimball, Inmon, Data WarehouseUpdated Dec 3, 2026
KW
Kailas Warade
✓ Verified Author
Data Engineer · Oracle Certified · SQL & PL/SQL
Kailas works with SQL, PL/SQL, Python, and PySpark to build data pipelines.
He writes the SQL interview guides at Sankalan Data Tech, focused on
practical, real-world answers.
🏆 Oracle Certified💼 Data Engineer📝 SQL & PL/SQL Guides📍 Pune, India
Dimensional modeling is a data warehouse design technique that organizes data into fact
tables (measurable business events) and dimension tables (descriptive context). It was
popularized by Ralph Kimball and is optimized for analytical queries and business
intelligence.
The core idea is simple: business users think in terms of business processes (sales,
orders, clicks) and the context around them (who, what, where, when). Dimensional
modeling mirrors this thinking.
Unlike normalized (3NF) models, which are optimized for transactional systems and minimize
redundancy, dimensional models are optimized for query performance and ease of use.
They accept some redundancy in exchange for faster, simpler analytical queries.
Dimensional modeling is the foundation of most modern data warehouses and BI systems. It
is what makes tools like Power BI, Tableau, and Looker work well.
Why Dimensional Modeling Matters
Dimensional modeling matters because it solves real problems in data warehousing.
Query performance. Star schemas use fewer joins than normalized models,
making analytical queries faster. Business users can query data without understanding
complex join logic.
Business alignment. Dimensional models mirror how business users think —
in terms of business processes and context. This makes the data warehouse intuitive to
use.
Consistency. Conformed dimensions ensure that the same customer, product,
or date means the same thing across all fact tables. This enables consistent reporting.
Scalability. Dimensional models handle large volumes of data well because
they are designed for read-heavy analytical workloads.
The trade-off is some data redundancy in dimensions, but this is acceptable in analytical
systems where query performance matters more than storage efficiency.
Fact Tables in Depth
A fact table stores measurable business events or transactions, such as sales, orders, or
clicks. It contains foreign keys to dimensions and numeric measures.
-- Fact table: sales
CREATE TABLE fact_sales (
sales_id BIGINT PRIMARY KEY,
date_key INT REFERENCES dim_date(date_key),
customer_key INT REFERENCES dim_customer(customer_key),
product_key INT REFERENCES dim_product(product_key),
store_key INT REFERENCES dim_store(store_key),
sales_amount DECIMAL(12,2),
quantity INT,
discount_amount DECIMAL(12,2)
);
The fact table is the center of the star schema. It answers "what happened" — each row is
one business event at a specific grain.
Fact tables are typically very large (millions to billions of rows) because they record
every event. They are mostly numeric and additive, which makes them efficient to
aggregate.
There are three types of fact tables:
Transaction fact tables: One row per business event (like a sale).
Periodic snapshot fact tables: One row per period (like daily inventory).
Accumulating snapshot fact tables: One row per process with milestones (like order lifecycle).
Dimension Tables in Depth
A dimension table stores descriptive attributes that provide context to facts, such as
customer, product, time, or geography. It is connected to the fact table via a foreign
key.
-- Dimension table: customer
CREATE TABLE dim_customer (
customer_key INT PRIMARY KEY,
customer_id INT,
customer_name VARCHAR(100),
city VARCHAR(100),
country VARCHAR(100),
segment VARCHAR(50)
);
Dimension tables answer "who, what, where, when" — the context around business events.
They are typically much smaller than fact tables (thousands to millions of rows).
Dimension tables are denormalized (wide and flat) to minimize joins. This is a deliberate
design choice for query performance.
Common dimension types include:
Conformed dimensions: Shared across multiple fact tables.
Role-playing dimensions: Same dimension used multiple times (like date for order date and ship date).
Junk dimensions: Combine low-cardinality flags into one dimension.
Degenerate dimensions: Dimension attributes stored in the fact table itself.
Star Schema in Depth
A star schema is a dimensional model where a central fact table is connected to multiple
dimension tables via foreign keys. The diagram resembles a star, hence the name.
The star schema is the most common dimensional model because it balances query
performance with design simplicity. It uses denormalized dimensions, which means fewer
joins and faster queries.
The star schema is optimized for read-heavy analytical workloads. Business users can
query data with simple joins between the fact table and dimensions.
Most modern BI tools are designed around star schemas, which is why they are the default
choice for data warehouses.
Grain and Measures
Grain is the level of detail stored in a fact table — what one row represents. It is the
most important design decision in dimensional modeling.
-- Grain: one row per order-item
-- Each row = one product in one order
-- Grain: one row per daily sales summary
-- Each row = total sales for one product on one day
Grain determines what questions you can answer. A finer grain (more detail) supports more
analysis but creates more rows. A coarser grain (less detail) is smaller but limits
analysis.
A measure is a numeric value in a fact table that can be aggregated, such as sales amount,
quantity, or profit. Measures are the numbers being analyzed.
Measures are typically additive (can be summed across any dimension), semi-additive (can
be summed across some dimensions but not others, like inventory balance), or
non-additive (cannot be summed, like ratios or percentages).
Slowly Changing Dimensions
A slowly changing dimension (SCD) is a dimension whose attributes change over time, such
as a customer's address. SCD techniques handle how these changes are tracked.
-- SCD Type 1: overwrite (no history)
UPDATE dim_customer SET city = 'Mumbai' WHERE customer_id = 101;
-- SCD Type 2: new row (full history)
INSERT INTO dim_customer (customer_id, city, effective_date, is_current)
VALUES (101, 'Mumbai', '2026-12-03', true);
UPDATE dim_customer SET is_current = false WHERE customer_id = 101 AND is_current = true;
SCD Type 1 overwrites the old value with the new value. No history is kept. It is the
simplest approach but loses historical context.
SCD Type 2 creates a new row for each change, preserving full history. It uses effective
dates and a current flag to track versions. This is the most common approach for
dimensions where history matters.
SCD Type 3 keeps limited history by adding a new column for the previous value. It tracks
only the most recent change, not full history.
Snowflake Schema
A snowflake schema is a star schema where dimension tables are further normalized into
sub-dimensions. It reduces redundancy but adds join complexity.
In a snowflake schema, the product dimension might be split into product, category, and
department tables. This reduces redundancy but requires more joins to query.
Snowflake schemas are less common than star schemas because the extra joins hurt query
performance. They are used when storage efficiency matters more than query speed.
The trade-off: snowflake saves storage but slows queries. Star schema uses more storage
but speeds queries. For most data warehouses, star schema wins.
25 Dimensional Modeling Interview Questions and Answers
These are the dimensional modeling questions that come up most often in data engineering
and BI interviews. Every answer stands on its own — read them in any order, or work
through them in sequence to build a complete understanding of dimensional modeling, star
schema, fact and dimension tables, and slowly changing dimensions.
/
🔍
No matching questions found
Try a keyword like fact table, SCD, grain, or star schema.
Dimensional modeling is a data warehouse design technique that organizes data into
fact tables (measurable business events) and dimension tables (descriptive
context). It was popularized by Ralph Kimball and is optimized for analytical
queries and business intelligence.
The core idea is that business users think in terms of business processes (sales,
orders, clicks) and the context around them (who, what, where, when). Dimensional
modeling mirrors this thinking.
Unlike normalized (3NF) models, which are optimized for transactional systems,
dimensional models are optimized for query performance and ease of use.
A star schema is a dimensional model where a central fact table is connected to
multiple dimension tables via foreign keys. The diagram resembles a star, hence the
name.
The star schema is the most common dimensional model because it balances query
performance with design simplicity. It uses denormalized dimensions, which means
fewer joins and faster queries.
Most modern BI tools are designed around star schemas, which is why they are the
default choice for data warehouses.
A fact table stores measurable business events or transactions, such as sales,
orders, or clicks. It contains foreign keys to dimensions and numeric measures.
The fact table is the center of the star schema. It answers "what happened" — each
row is one business event at a specific grain.
Fact tables are typically very large (millions to billions of rows) because they
record every event.
A dimension table stores descriptive attributes that provide context to facts, such
as customer, product, time, or geography.
CREATE TABLE dim_customer (
customer_key INT PRIMARY KEY,
customer_id INT,
customer_name VARCHAR(100),
city VARCHAR(100),
country VARCHAR(100)
);
Dimension tables answer "who, what, where, when" — the context around business
events. They are typically much smaller than fact tables.
Dimension tables are denormalized (wide and flat) to minimize joins.
Grain is the level of detail stored in a fact table — what one row represents. It is
the most important design decision in dimensional modeling.
-- Grain: one row per order-item
-- Each row = one product in one order
-- Grain: one row per daily sales summary
-- Each row = total sales for one product on one day
Grain determines what questions you can answer. A finer grain (more detail) supports
more analysis but creates more rows. A coarser grain (less detail) is smaller but
limits analysis.
Always define the grain first, before designing the rest of the model.
A measure is a numeric value in a fact table that can be aggregated, such as sales
amount, quantity, or profit. Measures are the numbers being analyzed.
-- Measures in a sales fact table
sales_amount, quantity, discount_amount
Measures are typically additive (can be summed across any dimension), semi-additive
(can be summed across some dimensions but not others), or non-additive (cannot be
summed).
Measures are what business users care about — they are the KPIs and metrics.
A slowly changing dimension (SCD) is a dimension whose attributes change over time,
such as a customer's address. SCD techniques handle how these changes are tracked.
-- Customer moves from Pune to Mumbai
-- SCD handles how this change is recorded
Without SCD, you would lose the historical context of where the customer lived when
they made a purchase. SCD preserves this context.
There are three main SCD types: Type 1 (overwrite), Type 2 (new row), and Type 3
(new column).
SCD Type 1 overwrites the old value with the new value. No history is kept.
-- SCD Type 1: overwrite
UPDATE dim_customer SET city = 'Mumbai' WHERE customer_id = 101;
This is the simplest approach but loses historical context. After the update, you
cannot know that the customer used to live in Pune.
Use Type 1 when history does not matter, like correcting data errors.
SCD Type 2 creates a new row for each change, preserving full history.
-- SCD Type 2: new row
INSERT INTO dim_customer (customer_id, city, effective_date, is_current)
VALUES (101, 'Mumbai', '2026-12-03', true);
UPDATE dim_customer SET is_current = false
WHERE customer_id = 101 AND is_current = true;
This preserves full history. You can query what the customer's city was at any point
in time.
Type 2 is the most common SCD approach for dimensions where history matters.
SCD Type 3 keeps limited history by adding a new column for the previous value.
-- SCD Type 3: new column
ALTER TABLE dim_customer ADD COLUMN previous_city VARCHAR(100);
UPDATE dim_customer SET previous_city = 'Pune', city = 'Mumbai'
WHERE customer_id = 101;
This tracks only the most recent change, not full history. It is useful when you
only need to compare current vs previous.
Type 3 is less common than Type 2 because it has limited history.
A snowflake schema is a star schema where dimension tables are further normalized
into sub-dimensions.
This captures the fact that a student attended a course on a date, without any
numeric measure. The "fact" is the event itself.
Factless fact tables are useful for coverage analysis (what did not happen).
A conformed dimension is a dimension shared across multiple fact tables, ensuring
consistent reporting.
-- Shared date dimension
fact_sales.date_key → dim_date.date_key
fact_inventory.date_key → dim_date.date_key
A shared date dimension ensures that "January 2026" means the same thing in both
sales and inventory reports. This enables consistent, cross-functional reporting.
Conformed dimensions are a core principle of the Kimball methodology.
A degenerate dimension is a dimension attribute stored in the fact table itself,
such as an order number. It has no associated dimension table.
The order number is a dimension (it identifies a business entity) but has no other
attributes worth storing in a separate table. So it stays in the fact table.
Degenerate dimensions are common for transaction identifiers.
Star schema has denormalized dimensions (fewer joins, faster queries). Snowflake
schema has normalized dimensions (less redundancy, more joins).
Aspect
Star Schema
Snowflake Schema
Dimension normalization
Denormalized
Normalized
Joins
Fewer
More
Query performance
Faster
Slower
Storage
More redundancy
Less redundancy
For most data warehouses, star schema wins because query performance matters more
than storage efficiency.
The Kimball methodology is a bottom-up approach to data warehousing that uses
dimensional modeling and star schemas. It was developed by Ralph Kimball.
-- Kimball approach
Business process → Fact table + Dimension tables → Data marts → Data warehouse
Kimball starts with business processes and builds data marts that are integrated
through conformed dimensions. This is contrasted with the Inmon approach, which is
top-down and starts with a normalized enterprise data warehouse.
Kimball is more common in practice because it delivers value faster.
The Inmon methodology is a top-down approach to data warehousing that starts with a
normalized enterprise data warehouse. It was developed by Bill Inmon.
-- Inmon approach
Source systems → Normalized EDW → Data marts → BI
Inmon builds a centralized, normalized data warehouse first, then creates data marts
on top. This is more rigorous but slower to deliver value.
Inmon is less common in practice than Kimball because it takes longer to deliver
value.
A surrogate key is a system-generated unique identifier for a dimension row, separate
from the business key.
-- Surrogate key in dimension table
CREATE TABLE dim_customer (
customer_key INT PRIMARY KEY, -- surrogate key
customer_id INT, -- business key
...
);
Surrogate keys are essential for SCD Type 2 because the same business key can have
multiple rows (one per version). The surrogate key uniquely identifies each version.
Surrogate keys are typically integers, which are efficient for joins and indexing.
A role-playing dimension is the same dimension used multiple times in a fact table,
with different roles.
-- Date dimension used for order date and ship date
fact_orders.order_date_key → dim_date.date_key
fact_orders.ship_date_key → dim_date.date_key
The same date dimension serves two roles: order date and ship date. This avoids
duplicating the date dimension.
Role-playing dimensions are common for date, employee, and location dimensions.
A junk dimension combines low-cardinality flags and indicators into one dimension
table.
Bridge tables solve the many-to-many problem that a simple star schema cannot
handle. They are common in banking, insurance, and healthcare.
Bridge tables add complexity but are necessary when the relationship is
many-to-many.
A late-arriving dimension is a dimension row that arrives after the fact row that
references it. This creates a temporary orphan.
-- Late-arriving dimension
Fact row arrives → dimension row not yet available → use "Unknown" member
Dimension row arrives later → update fact row
The standard solution is to use an "Unknown" member in the dimension, then update
the fact row when the dimension arrives.
Late-arriving dimensions are a common real-world challenge in data warehousing.
A data warehouse is a centralized repository for all enterprise data. A data mart is
a subset of the warehouse focused on a specific business area.
Aspect
Data Warehouse
Data Mart
Scope
Enterprise-wide
Department or business area
Data
All data
Subject-specific data
Users
Enterprise-wide
Specific department
Data marts are built on top of the data warehouse, or independently in the Kimball
approach.
A business key is the natural identifier from the source system (like customer_id).
A surrogate key is a system-generated identifier for the warehouse.
-- Business key: customer_id = 101
-- Surrogate key: customer_key = 1, 2, 3 (one per SCD version)
Business keys can change or repeat (in SCD Type 2). Surrogate keys are stable and
unique, making them ideal for fact-dimension joins.
Surrogate keys are the standard practice in dimensional modeling.
Well-designed dimensional models follow a few key principles.
Define grain first — before designing anything else.
Use conformed dimensions — for consistent reporting across fact tables.
Use surrogate keys — for stable, efficient joins.
Use SCD Type 2 for history — when historical context matters.
Prefer star schema over snowflake — for query performance.
Keep dimensions denormalized — to minimize joins.
-- Well-designed star schema
-- Grain: one row per order-item
-- Conformed dimensions: date, customer, product
-- Surrogate keys throughout
-- SCD Type 2 for customer and product
These principles produce a dimensional model that is fast, consistent, and easy to
use.
Mistakes I Keep Seeing in Interviews
These come up repeatedly. None of them are exotic, and every one of them is easy to avoid
once you know it is coming.
Mistake one: confusing fact and dimension tables. Candidates often mix up
which is which. Fact = measurable events. Dimension = descriptive context.
Mistake two: not understanding grain. This is the single most important
design decision, and not knowing it is a red flag.
Mistake three: confusing star schema with snowflake schema. Know the
difference: normalization of dimensions.
Mistake four: not knowing SCD types. Type 1, 2, and 3 are fundamental and
come up in almost every dimensional modeling interview.
Mistake five: confusing Kimball with Inmon. Know the difference: bottom-up
vs top-down.
Mistake six: not understanding surrogate keys. They are essential for SCD
and efficient joins.
Follow-Up Questions Interviewers Ask
Getting the first answer right is only half the interview. What usually decides the
outcome is what happens next. Here is what to prepare for on the dimensional modeling
topic.
After “What is dimensional modeling?” — expect
“What is a fact table?”
“What is a dimension table?”
“What is grain?”
“What is a star schema?”
After “SCD” — expect
“What are the SCD types?”
“When would you use Type 2?”
“How do you implement Type 2?”
“What is a surrogate key?”
After “Star schema” — expect
“How does it differ from snowflake?”
“Why is it called a star?”
“What is a conformed dimension?”
“What is a role-playing dimension?”
After “Kimball vs Inmon” — expect
“What is the difference?”
“Which is better?”
“When would you use each?”
“What is a data mart?”
For every question above, prepare a second-level answer. The candidates who pass are not
the ones who memorized the first answer — they are the ones who kept going for another
thirty seconds and said something useful about why it matters.
Quick Quiz
Three questions to check whether the topics above have landed.
1. What does a fact table store?
2. Which SCD type preserves full history?
3. What is the most important design decision in dimensional modeling?