1. University MCA (AI/ML) Semester 2
  2. CAB206
  3. Unit 2

CAB206 · Unit 2: Data warehousing and ETL

Dimensional modelling: facts, dimensions, star and snowflake

8 practice questions

Key points

  • Fact = measures + keys; dimension = descriptive attributes
  • Declare the grain first
  • Star = denormalised dims; snowflake = normalised dims
  • Additive, semi-additive (balances), non-additive (ratios)
  • Duplicate dimension keys cause fan-out and inflated totals

Dimensional modelling (Ralph Kimball) organises data for fast, understandable analysis.

  • A fact table records measurable events (sales, clicks) with numeric measures and foreign keys to dimensions. Its grain is what one row represents (for example, one order line).
  • A dimension table holds descriptive attributes (product, customer, date, store) used to filter, group and label.
  • Star schema: a central fact table joined directly to denormalised dimensions. Simple, few joins, fast.
  • Snowflake schema: dimensions are normalised into sub-tables (product, category). Saves some space but adds joins.

Four design steps: choose the business process, declare the grain, identify the dimensions, identify the facts.

Measure additivity

  • Additive: can be summed across every dimension (sales amount, quantity).
  • Semi-additive: summable across some dimensions but not time (account balance, inventory level).
  • Non-additive: cannot be summed (ratios, percentages, unit prices); store the numerator and denominator and divide after summing.

Useful patterns

  • Surrogate key: meaningless integer key owned by the warehouse; isolates it from source-key changes and supports history.
  • Conformed dimension: shared, identically defined dimension (for example, one Date or Customer dimension) used by several fact tables.
  • Degenerate dimension: an identifier such as an order number kept in the fact table with no dimension table.
  • Role-playing dimension: one dimension used in several roles (Date as order date and ship date).
  • Junk dimension: groups low-cardinality flags into one small dimension.
  • Factless fact table: records that an event happened or a relationship exists, with no numeric measure (attendance).

Fact table types: transaction (one row per event), periodic snapshot (state at regular intervals), accumulating snapshot (one row per process instance, updated as milestones are reached).

Fan-out. If a dimension has duplicate rows for the same key, joining multiplies fact rows and inflates totals.

Try two questions

Question 1 · Tier 3, Apply

With the same five fact rows, the product dimension accidentally holds two identical current rows for key 2 (Novel, Books). A join of fact to dimension returns how many rows and what Books total?

  1. 5 rows and a Books total of 900
  2. 7 rows and a Books total of 900
  3. 10 rows and a Books total of 900
  4. 7 rows and a Books total of 1,800
Show the answer

D. Each of the two Books fact rows matches two dimension rows, so 3 + 4 = 7 rows and Books sums to 2 x 900 = 1,800.

Question 2 · Tier 2, Understand

Which design step should be decided before choosing the dimensions and facts?

  1. Pick the chart colours
  2. Schedule the printing of reports
  3. Declare the grain
  4. Select the dashboard font
Show the answer

C. Kimball's steps are: choose the process, declare the grain, then identify dimensions and facts.