Data warehouse modelling: schemas for multidimensional data models
How a data warehouse stores data as a cube of facts and dimensions, the star, snowflake and fact-constellation schemas that implement it, cuboid lattices and OLAP operations. GATE asks schema identification, cuboid counts and OLAP-operation questions.
A data warehouse is a subject-oriented, integrated, time-variant and non-volatile collection of data that supports decision making.
Subject-oriented: organised around subjects such as sales or customers, not around applications.
Integrated: built from several sources with naming, units and encodings made consistent.
Time-variant: keeps history (often 5–10 years); every key has a time element.
Non-volatile: loaded and read, not updated by day-to-day transactions.
OLTP (operational DB)
OLAP (warehouse)
Users
clerks, applications
analysts, managers
Data
current, detailed
historical, summarised
Design
ER, normalized (3NF)
star / snowflake
Access
short read-write transactions
long read-mostly queries, scans
Size
GB
TB and more
OLAP servers come in three kinds: ROLAP (cube on a relational DBMS), MOLAP (cube in multidimensional arrays) and HOLAP (hybrid: detail in ROLAP, aggregates in MOLAP).
2. The data cube, cuboids and the lattice
The multidimensional data model views data as a cube. Dimensions are the perspectives of analysis (time, item, location); each dimension has a dimension table of attributes. Measures are the numeric facts being analysed (units sold, rupees sold), stored in a fact table with foreign keys to the dimensions.
Grouping by any subset of the dimensions gives a cuboid. All subsets together form a lattice of cuboids:
the base cuboid groups by all dimensions (lowest summarisation);
the apex cuboid groups by none: one cell with the grand total, written all;
the number of -D cuboids is , and the total is .
With concept hierarchies, dimension can be grouped at any of its levels or not at all, so the total number of cuboids is .
If dimension has distinct values, the base cuboid has at most cells, and the full cube (all cuboids together) has at most cells, the being the value all.
Lattice of the 8 cuboids for the dimensions time, item and location: apex at the top, base cuboid at the bottom
3. Star, snowflake and fact constellation schemas
Star schema: one central fact table (foreign keys + measures) joined directly to one denormalized table per dimension. Few joins, fast queries, some redundancy in dimension tables. The most common design.
Snowflake schema: a star schema whose dimension tables are normalized into further tables (item → supplier, location → city). Saves space and avoids update anomalies in dimensions, but needs more joins, so queries are slower.
Fact constellation (galaxy schema): several fact tables share dimension tables (for example sales and shipping both use time, item and location). Used for an enterprise-wide warehouse; a data mart for one department usually uses a star or snowflake.
Star
Snowflake
Fact constellation
Fact tables
1
1
2 or more
Dimension tables
denormalized
normalized
shared
Joins per query
fewest
more
depends
The fact table is the largest table; its primary key is usually the combination of the dimension foreign keys.
Star schema: the sales fact table in the centre holds one foreign key per dimension plus the measures
4. OLAP operations on the cube
Roll-up (drill-up): summarise further, either by climbing a concept hierarchy (city → state) or by removing a dimension. Fewer, larger cells.
Drill-down: the reverse: step down a hierarchy (quarter → month) or add a dimension. More detail.
Slice: fix one dimension to a single value (time = Q1). The result is a subcube with one dimension fewer.
Dice: select on two or more dimensions (time ∈ {Q1, Q2} and location ∈ {Delhi, Pune}). The result is a smaller subcube with the same dimensions.
Pivot (rotate): swap the axes of the view (rows ↔ columns). The data does not change.
Other operations: drill-across (query across two fact tables) and drill-through (go from the cube to the underlying relational rows).
When to use which: "from monthly to quarterly totals" is roll-up; "break the 2024 total into months" is drill-down; "only for Mumbai" is a slice; "for these two cities and these three items" is a dice.
5. Materialisation and cube size
Computing every cuboid in advance (full materialisation) answers any group-by instantly but can need huge space: cuboids without hierarchies, with them. Computing none (no materialisation) saves space but every query aggregates from the base data.
Warehouses therefore use partial materialisation: precompute a chosen subset of cuboids (for example those queried often) and answer the rest from the smallest materialised ancestor in the lattice. A cuboid can be computed from any cuboid below it in the lattice (one that groups by a superset of its dimensions), because a coarser group-by is an aggregate of a finer one.
Most cells of a large base cuboid are empty, so cubes are sparse; is only an upper bound on the number of non-empty cells. An iceberg cube stores only cells whose measure passes a threshold (for example count ≥ 10).
Formulas to remember
Cuboids without hierarchies dimensions
Number of k-D cuboids
Cuboids with hierarchies = levels of dimension , not counting *all*
Maximum base-cuboid cells = distinct values of dimension
Maximum cells in the full cubeThe extra value per dimension is *all*
Common mistakes
Forgetting the +1 for all when counting cuboids with hierarchies: it is , not .
Confusing slice (one dimension, one value) with dice (conditions on two or more dimensions).
Calling a schema with two fact tables a snowflake; shared dimensions with several fact tables make a fact constellation.
Thinking roll-up only removes dimensions; climbing a concept hierarchy is also roll-up.
Treating as the actual number of cells; most cubes are sparse and it is only an upper bound.
Worked examples
Try each step yourself, then reveal the working.
Example 1: Counting cuboids with and without hierarchies
numerical
A cube has 4 dimensions: time, location, item and supplier. (a) How many cuboids are there if no dimension has a hierarchy? (b) Now time has the levels day, month, quarter, year; location has city, state, country; item has name, type; supplier has one level. How many cuboids?
Step 1: Count the subsets of 4 dimensions.
Try it on paper first.
Example 2: How many cells can the cube have?
numerical
A sales cube has dimensions product (10 values), city (5 values) and month (12 values), no hierarchies. Find the maximum number of cells in (a) the base cuboid, (b) the (product, city) cuboid, (c) the full cube.
Step 1: Base cuboid: one cell per combination of all three.
Try it on paper first.
Example 3: Star or snowflake?
conceptual
A sales warehouse has a fact table with keys to time, item, branch and location. The item table repeats supplier name and supplier phone on every row; the location table repeats state and country. Describe the star and snowflake designs and count the tables in each.
Step 1: Write the star schema.
Try it on paper first.
Example 4: Name the OLAP operation
conceptual
On a cube (time, item, location): (i) from city-wise sales to state-wise sales; (ii) only the sales of the year 2024; (iii) sales for items {TV, phone} in cities {Delhi, Chennai} during Q1 and Q2; (iv) show items as rows and cities as columns instead of the reverse.
Step 1: Is the data being summarised or narrowed?
Try it on paper first.
Previous year questions
3 official GATE DA questions on this topic, newest first.
10 questions: up to 3 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.