This document discusses different types of dimensional data modeling for data warehouses. It describes star schemas as having a central fact table connected to dimension tables. Snowflake schemas refine star schemas by normalizing dimensional hierarchies into smaller dimension tables. Fact constellations have multiple fact tables that share dimension tables, forming a galaxy schema with interconnected stars.
3. Modeling data warehouses: dimensions & measures
Star schema
Snowflake schema
Fact constellations
3 3
4. product prodId name price store storeId city
p1 bolt 10 c1 nyc
p2 nut 5 c2 sfo
c3 la
sale oderId date custId prodId storeId qty amt
o100 1/7/97 53 p1 c1 1 12
o102 2/7/97 53 p2 c1 2 11
105 3/8/97 111 p1 c3 5 50
customer custId name address city
53 joe 10 main sfo
81 fred 12 main sfo
111 sally 80 willow la
4 4
5. Modeling data warehouses: dimensions & measures
Star schema: A fact table in the middle connected
to a set of dimension tables
5 5
6. Modeling data warehouses: dimensions & measures
Snowflake schema: A refinement of star schema
where some dimensional hierarchy is normalized
into a set of smaller dimension tables, forming a
shape similar to snowflake
store
city region
6 6
7. store
city region
sType tId size location
t1 small downtown
store storeId cityId tId mgr t2 large suburbs
s5 sfo t1 joe
s7 sfo t2 fred city cityId pop regId
s9 la t1 nancy sfo 1M north
la 5M south
region regId name
north cold region
south warm region
7
8. Connects entities to dimension tables rather
than the fact table
Complicates coding and requires additional
processing for retrievals
Useful for seldom used lookups
8
9. time
time_key item
day item_key supplier
day_of_the_week Sales Fact Table item_name supplier_key
month brand supplier_type
quarter time_key type
year item_key supplier_key
branch_key
branch location
location_key
location_key
branch_key
units_sold street
branch_name
city_key
branch_type
dollars_sold city
city_key
avg_sales city
state_or_province
Measures country
9 9
10. Modeling data warehouses: dimensions & measures
Fact constellations: Multiple fact tables share
dimension tables, viewed as a collection of stars,
therefore called galaxy schema or fact
constellation
10 10
11. time
time_key item Shipping Fact Table
day item_key
day_of_the_week Sales Fact Table item_name time_key
month brand
quarter time_key type item_key
year supplier_type shipper_key
item_key
branch_key from_location
branch location_key location to_location
branch_key location_key dollars_cost
branch_name
units_sold
street
branch_type dollars_sold city units_shipped
province_or_state
avg_sales country shipper
Measures shipper_key
shipper_name
location_key
11
shipper_type
11 11
12. The Data Warehouse Toolkit.Second
Edition.The Complete Guide to Dimensional
Modeling.Ralph Kimball.Margy Ross