160 likes | 178 Views
Explore star schema in data warehousing: grain, slowly changing dimensions, snowflake schema, additivity of measures, examples, class exercises, and design process differences from OLTP. Homework and case studies included.
E N D
Data Warehouse (VI): Examples of the star schema Developed by: Dr Eddie Ip Modified by: Dr Arif Ansari
Outline • Review of concept of grain • Advanced concepts • Slowly changing dimensions • Snow flake schema • Additivity of measures & other issues • PC Manufacturer example • Homework 1B
Dimension Fact
Grain • Level of detail of data • Important concept – defines what a fact really represents
Slowly changing dimension • Dimension tables are relatively stable • Sometimes still need change • Change different from OLTP • E.g., customer address change • Types of change • Type 1 • Type 2 • Type 3
Slowly changing dimensions • Type 1 • Simple update • Type 2 • Add new row to dimension table • E.g., new address, same customer • Type 3 • Add new column • E.g., new territory designation of sales force
Snow-flake schema • Dimension tables further normalized • Number of attributes large (high cardinality) • Create tables for attributes within a dimension table
Snow-flake schema • E.g. store dimension has district as attribute • District has district description, district manager, district HQ attributes • Alternative design (snow-flake): 2 separate fact tables
Dimension Fact Snow flake schema
Additivity • Can facts be added (summarized) across dimensions? • Fully additive (across all dimensions) • Sales, number of units sold • Semi-additive • Additive across some dimensions • E.g., account balances cannot be added across days • Non-additive
Multiple stars • Basic idea: one process, one star • Different stars may be necessary when the business requires data • Of varying grains • Are measured at different intervals(order and shipping)
Class exercise • Star schema of a hotel
Homework 1B: Car maker DW • From A& V p.33 • Concerns: • Is minivan incentive ($200/minivan) working? • Are dealers abusing the lease option?
Car maker DW • Measures = ? • Actual sales price • MSRP base price • Options price • Dealer add-ons • MSRP full price (=MSRP base + option) … • Dimension = ? • E.g., product
Car maker DW • Queries can be created to address the concerns • Examples of Reports (p. 40, 41, 42)
Summary • Review of Star Schema • Example • Class exercise • The DW design process (DW Vs OLTP)