Star Schema

Context: FIT3003_MOC Parent Framework: Data Warehouse

Quick Revision

  • 🎯 Objective: a data modelling technique that maps multidimensional decision-support data into a relational database ➔ one central fact surrounded by qualifying dimensions.
  • 📦 Core Components: Facts ➔ numeric measurements | Dimensions ➔ qualifying perspectives | Attributes ➔ properties within a dimension.
  • ⚡ Key Constraint: picking the fact and its grain. The required analysis questions dictate the dimensions — derive them from the questions, never guess.

📝 How It Works

1. Why it exists

  • Core Mechanism: Analysis-driven design ➔ ER modelling and normalisation did not yield a database structure serving advanced data-analysis requirements, so dimensional modelling was developed to sit on the same relational technology.
  • Structural Invariant: Relational underneath ➔ the star is ordinary tables; the “cube” of the Data Warehouse is the logical view those tables present.

2. Facts

  • Core Mechanism: Numeric measurements ➔ values representing a specific business aspect or activity (sales figures measuring product/service sales; fee amounts measuring income).
  • Structural Invariant: Fact table shape — the primary key is the composite of the dimension foreign keys; every non-key column is a measure.

3. Dimensions

  • Core Mechanism: Qualifying characteristics ➔ perspectives added to a fact; sales viewed by sales location, sales period, sales product.
  • Structural Invariant: One hop only ➔ each dimension joins directly to the fact (that is what makes the picture a star); a dimension is not further normalised into sub-tables.

4. Attributes

  • Core Mechanism: Properties in a dimension ➔ the descriptive columns a dimension carries (a country attribute inside a student dimension; a level attribute inside a course dimension).
  • Structural Invariant: Attributes are what you group by ➔ an analysis question can only slice on an attribute that some dimension actually stores.

5. Notation conventions (W2 — must be reproduced exactly in the assignment)

  • Naming: XxxDIM / XxxFACT ➔ dimensions and the fact are named by suffix; connecting lines may be straight or bent, and the dimension under discussion is highlighted in the diagram.
  • Keys: Dimension ID is the dimension’s PK ➔ the same column appears inside the fact as FK and part of the composite PK, drawn in bold italic above the separator line; measures sit below it.
  • Fact content: Numerical only ➔ a fact may hold only numerical values; anything descriptive belongs in a dimension ➔ Fact Measure Aggregation Rules.
  • Source-side E/R notation: ENTITY capitalised, keys marked PK / FK, Crow’s-foot relationships with participation, associative relationship m–m, non-associative 1–m ➔ Entity Relationship Diagram (ERD), Cardinality (Crow’s Foot Notation).

6. Transformation process

⚙️ Schema Layout

🔹 Generic star

📊 Exam Execution Trace & Applied Exercises

Derivation Trace — question ➔ dimension

(the mechanical method: read each required analysis question, extract the grouping term and the measure)

#Analysis questionGrouping term ➔ dimensionMeasure ➔ fact column
1Total income from certain countriescountry ➔ CountryTotal_Income
2Total income for postgraduate courses in a yearcourse level ➔ Course · year ➔ Enrolment YearTotal_Income
3Total income as a result of each agentagent ➔ AgentTotal_Income
4How many payments generated each yearyear ➔ Enrolment YearNumber_of_Payments
  • Grain falls out of the source ➔ students pay “several times, normally once every semester, for each course” ⟹ one fact row per payment.
  • Dimensions come only from the questions ➔ the lecture’s answer set is exactly Country, Course, Agent, Enrolment Year; campus is not a dimension here because no analysis question asks for it.

Applied Exercise — International College enrolment star

Problem: the admission office handles enrolment, payment and marketing for international students of a multi-campus college, some recruited through overseas educational agents. Design the star schema answering the four questions above.

🧠 Active Recall