1. Gyanastra
  2. Database Systems
  3. UGC NET: Data Warehousing and OLAP
  4. Warehouse Modeling and Schemas
Free lesson, no account needed 11 min read 11 practice questions after it
Asked in past papers2 times
  • UGC NET20142007

Database Systems · UGC NET: Data Warehousing and OLAP

Warehouse Modeling and Schemas

Overview

A data warehouse is a central analytical repository built from many operational sources.
William Inmon’s classic definition is that a data warehouse is subject-oriented, integrated, time-variant and non-volatile, and it supports management decisions.
In this lesson you learn how warehouse data is structured: fact tables, dimension tables, star/snowflake/fact-constellation schemas, data marts, granularity, surrogate keys, conformed dimensions, factless fact tables, and the ETL process that prepares data before loading.
You should already know basic relations, keys, functional dependencies, ER modelling and SQL joins; warehouse modelling then explains why analytical databases deliberately differ from normalized OLTP databases.

Key concepts

  • Data warehouse: subject-oriented, integrated, time-variant, non-volatile collection of data in support of management decisions.
  • Subject-oriented: organised around business subjects such as sales, customer, product or finance, not around individual applications.
  • Integrated: data from many sources is made consistent in names, codes, units and formats.
  • Time-variant: stores history; every fact normally carries a time key, so past and present can be compared.
  • Non-volatile: data is loaded and refreshed, not updated by day-to-day transactions; users mainly read and analyse it.
  • OLTP vs OLAP: OLTP systems process routine transactions; OLAP systems analyse large historical data for decision support. A warehouse provides storage and analytical query responsiveness, not transaction responsiveness.
  • Dimensional modeling: Ralph Kimball’s design approach that organises warehouse data into fact tables and dimension tables. It defines structures and stores data; it is not merely a view or retrieval tool.
  • Fact table: central table in a dimensional schema. It contains foreign keys to dimension tables and one or more numeric measures. Its grain is the meaning of one row.
  • Factless fact table: a fact table with no measure columns. It contains dimension keys, usually surrogate keys, and records an event or coverage, e.g. which student attended which seminar on which date.
    Following the Kimball convention, a degenerate dimension may appear in practice, but it is not a measure.
  • Dimension table: descriptive context for facts. It contains attributes such as product name, category, store city, customer segment. Dimensions are usually denormalized in a star schema.
  • Surrogate key: a system-generated integer key with no business meaning, used to join a fact to a dimension and to keep history stable.
  • Conformed dimension: a dimension table shared by multiple fact tables, so measures from different business processes can be compared consistently.
  • Granularity: the level of detail stored in a fact table. Fine grain means detailed rows; coarse grain means aggregated rows.
  • Measure: numeric value in a fact table. Additive measures can be summed over all dimensions, such as sales amount. Semi-additive measures can be summed over some dimensions but not time, such as account balance.
    Non-additive measures cannot be meaningfully summed, such as ratios or unit price.
  • Concept hierarchy: a sequence of mappings from low-level concepts to higher-level concepts, e.g. product → category → department, or date → month → year. It supports roll-up and drill-down.
  • Star schema: one central fact table connected directly to denormalised dimension tables. Simple, fewer joins, some redundancy.
  • Snowflake schema: dimensions are normalised into multiple related tables. Less redundancy and more joins.
  • Fact constellation / galaxy schema: multiple fact tables share one or more conformed dimensions.
  • Data mart: a departmental or subject-specific subset of a warehouse. It may contain summarised, denormalised and aggregate departmental data.
    A dependent data mart is fed from the warehouse; an independent data mart is built directly from sources.
  • ETL: Extract, Transform, Load. Transform includes data cleaning or data scrubbing, standardisation, integration, derivation and aggregation. Scrubbing improves data quality before loading into the warehouse.
  • Denormalisation note: star-schema dimensions are intentionally denormalised. Warehouse schemas often violate strict 3NF because controlled redundancy reduces joins and improves analytical query performance.

How it works

  1. Choose the business process and grain. Decide the subject, such as sales, and the exact meaning of one fact row: one product line per order, one account balance per day, or one student attendance event.
  2. Identify dimensions. List the descriptive entities that give context: date, product, customer, store, student, seminar. Add attributes and concept hierarchies.
  3. Identify measures. Put numeric measures in the fact table only where they make sense. Check additivity before placing them there.
  4. Assign keys. Give each dimension a surrogate primary key. The fact table stores foreign keys to those dimensions.
  5. Choose the schema. Use a star schema for simple, fast dimensional queries; use a snowflake schema when dimension hierarchies are normalized; use a fact constellation when several fact tables share dimensions.
  6. Perform ETL. Extract from sources, scrub and standardise data, transform it to the dimensional model, and load it with time keys. Loads are periodic; ordinary users do not update warehouse facts transaction by transaction.
  7. Query with OLAP tools. Users aggregate, slice and compare data. A well-designed schema makes these analytical queries fast and understandable.
Figure. The fact table, Fact_Sales, links directly to four dimension tables. This central fact table with surrounding dimensions illustrates the star schema used for simple, fast dimensional queries.

Worked examples

Example 1. A retail chain, Meena Stores, wants to analyse sales by product, store and month for the last five years. It extracts data from billing, inventory and loyalty systems and loads it once a month. Identify the four Inmon properties shown here.

Steps:

  1. The warehouse is organised around sales, not around each application, so it is subject-oriented.
  2. Billing, inventory and loyalty records must use the same product and store codes, so it is integrated.
  3. Five years of monthly history is stored, so it is time-variant.
  4. Monthly loading and read-only analysis mean ordinary transaction updates are not applied, so it is non-volatile.
    Answer: subject-oriented, integrated, time-variant, non-volatile.

Example 2. Match List-I with List-II.

List-IList-II
A. Factless fact table1. System-generated key with no business meaning
B. Conformed dimension2. Table with dimension keys but no measures
C. Snowflake schema3. Normalised dimension tables with extra joins
D. Surrogate key4. Dimension shared across multiple fact tables

Steps: A records events with no measure, so A-2. A conformed dimension is shared, so B-4. A snowflake normalises dimensions, so C-3. A surrogate key is system-generated and meaningless, so D-1.
Answer: A-2, B-4, C-3, D-1.

Example 3. Geeta’s online store has Fact_Order with keys DateKey, ProductKey, CustomerKey, StoreKey and measures Quantity, UnitPrice, SalesAmount. Each row means one product line in one order. All dimension tables are single denormalised tables.
Name the schema, the grain and the measure type of UnitPrice.

Steps:

  1. One central fact table joins directly to four dimension tables: this is a star schema.
  2. One row means one product within one order: the grain is order line.
  3. SalesAmount and Quantity can be summed across dimensions, so they are additive. UnitPrice cannot be meaningfully summed, so it is non-additive.
    Answer: star schema; grain is order line; UnitPrice is non-additive.

Example 4. A star schema has Fact_Sales and dimensions Dim_Date, Dim_Customer, Dim_Product. In a snowflake version, Dim_Product is split into Product, Category and Department, and Dim_Customer is split into Customer and City. Count tables and joins in both.

Steps:

  1. Star tables: Fact + Date + Customer + Product = 4 tables. Joins from fact to the three dimensions = 3 joins.
  2. Snowflake tables: Fact + Date + Product + Category + Department + Customer + City = 7 tables.
  3. Snowflake joins: Fact–Date, Fact–Product, Product–Category, Category–Department, Fact–Customer, Customer–City = 6 joins.
    Answer: star 4 tables and 3 joins; snowflake 7 tables and 6 joins. The snowflake reduces redundancy but adds joins.

Example 5. Statement I: A factless fact table records events or coverage using dimension keys and no measures. Statement II: A snowflake schema stores dimensions in denormalised form. Choose the correct option: both true, both false, I true and II false, or I false and II true.

Steps: Statement I is true by definition. Statement II is false: a star schema is denormalised; a snowflake normalises dimensions.
Answer: Statement I is true and Statement II is false.

Comparison

AspectFact tableDimension table
PurposeStores measurements/eventsStores descriptive context
Main contentForeign keys + numeric measuresAttributes and hierarchies
Primary keyComposite key of dimension keysSurrogate key
SizeUsually many rowsUsually fewer rows
ExampleSales amount by product, date, storeProduct name, category, department
FeatureStar schemaSnowflake schemaFact constellation
DimensionsDenormalised, one table per dimensionNormalised into related tablesShared conformed dimensions
JoinsFewerMoreMany, across multiple facts
RedundancyHigherLowerModerate
Query simplicityHighLowerComplex
Typical useCommon data marts/warehouseSpace saving or maintained hierarchiesEnterprise warehouse with several processes
AspectData warehouseData mart
ScopeEnterprise-wideDepartmental or subject-specific
DataIntegrated historical dataSubset, often summarised/aggregated
UsersMany departmentsOne department or group
SourceMultiple operational systemsWarehouse or direct sources
TypeCentral repositoryDependent or independent mart
AspectOLTPOLAP
PurposeRoutine transactionsAnalysis and decision support
DataCurrent, detailedHistorical, summarised
OperationsInsert/update/deleteMostly read and aggregate
SchemaHighly normalisedDimensional, often denormalised
Query styleShort, simpleComplex, large aggregations

Revision summary

  • Inmon’s four properties: subject-oriented, integrated, time-variant, non-volatile; mnemonic SITN.
  • A data warehouse is always subject-oriented, not object-oriented or program-oriented.
  • A normal fact table has foreign keys plus measures; a factless fact table has keys and no measures.
  • Star: denormalised dimensions; Snowflake: normalised dimensions; Constellation: multiple fact tables.
  • Grain is the exact meaning of one fact row; choose it before choosing measures.
  • Surrogate keys are system-generated and carry no business meaning.
  • Conformed dimensions are shared across fact tables for consistent analysis.
  • Data scrubbing is done in ETL before loading into the warehouse.
  • Data marts may hold summarised, denormalised and aggregate departmental data.
  • Warehouse schemas often violate 3NF because denormalisation reduces joins and improves analytical query speed.
  • A warehouse stores historical and summarised data that is normally not found in operational systems.
  • Do not confuse “no measures” in a factless fact table with “no keys”; it still needs dimension keys.

Previous-year exam insights

  • Direct definition questions ask for the four Inmon properties or the statement that a data warehouse is subject-oriented.
  • Factless fact table questions test the trap “only measures” versus the correct idea: no measures, dimension/surrogate keys only.
  • Schema-identification questions give a central fact table with denormalised dimensions: answer is star; normalised dimensions: snowflake; multiple facts sharing dimensions: fact constellation.
  • Data mart questions often test that a mart is departmental and may contain summarised, denormalised or aggregate data.
  • ETL questions place data scrubbing before loading into the warehouse; options about rejecting data after loading or creating indexes are traps.
  • Dimensional modelling questions test that it defines and stores structures through fact and dimension tables, not merely views or retrieval.
  • Statement I/II and assertion-reason questions contrast star versus snowflake and denormalisation versus redundant joins.
  • Match-the-list questions pair factless table, conformed dimension, surrogate key, granularity, star, snowflake and data mart; check the exact wording of each description first.

Practice at PARIKSHA

You are ready for the PARIKSHA tests of this sub-topic when you can:

  1. Write Inmon’s four properties and explain each with a retail example.
  2. Distinguish a fact table from a dimension table by content, key and purpose.
  3. Explain why a factless fact table has no measures and state what keys it contains.
  4. Identify star, snowflake and fact-constellation schemas from a given table layout.
  5. Count the number of tables and joins in a small star versus snowflake design.
  6. Define grain and decide the grain for an order, attendance or bank-account fact.
  7. Classify measures as additive, semi-additive or non-additive.
  8. Explain surrogate keys, conformed dimensions and concept hierarchies.
  9. State where data scrubbing occurs in ETL and why it is done before loading.
  10. Compare a data warehouse with a data mart and an OLTP system with an OLAP system.

Attempt the PARIKSHA sub-topic test first, then the subject test.

Pages 1–2 of 2