DW Dimensional Modeling
DW Dimensional Modeling
DW Dimensional Modeling
IIM Ahmedabad
Learning objectives
Dimensional modeling
OLAP
DMBI IIMA 2
What is a Data Warehouse
Data warehousing:
The process of constructing and using data warehouses
DMBI IIMA 3
Feature OLTP OLAP
DMBI IIMA 4
Data Warehouse: A Multi-tiered Architecture
DMBI IIMA 5
Use of Metadata
DMBI IIMA 6
Multi-dimensional data modeling
DMBI IIMA 8
A Sample Data Cube
DMBI IIMA 9
Aggregate, Group By, Cross Tab and Cube: An
Illustrative Example
DMBI IIMA 10
Conceptual Modeling of Data Warehouses
DMBI IIMA 11
Star schema
Time Item
time key (PK) item key (PK)
day item name
day of the week brand
month Sales type
quarter supplier name
year time key (FK) supplier type
item key (FK)
branch key (FK)
loc key (FK)
qtySales
Branch dollarSales Location
branch key (PK) avgSales loc key (PK)
branch name street
branch type city
state
DMBI IIMA 12
Snowflake schema
Supplier
Time Item supplier key (PK)
supplier name
time key (PK) item key
supplier type
day (PK)
day of the week item name
month Sales brand
quarter type
year time key (FK) supplier key
item key (FK)
branch key (FK)
loc key (FK)
qtySales
Branch dollarSales Location
branch key (PK) avgSales loc key (PK)
branch name street
branch type city key
City
city key (PK)
city
state
DMBI IIMA 13
Fact Constellation schema Shipping
Time time key (FK)
item key (FK)
time key (PK)
shipper key (FK)
day Item from loc key (FK)
day of the week
item key (PK) to loc key (FK)
month
Sales item name qtyShipped
quarter
brand dollarCost
year time key (FK) type
item key (FK) supplier name
branch key supplier type
(FK)
loc key (FK)
qtySales
Branch dollarSales Location
branch key avgSales loc key (PK)
(PK) street
branch name city Shipper
branch type state shipper key (PK)
shipper name
shipper type
DMBI IIMA 14
Factless Fact Table
Sales fact table typically captures only products that were sold
DMBI IIMA 15
Fact Table: Measure Types
DMBI IIMA 16
Degenerate Dimension (DD)
DMBI IIMA 17
Surrogate Keys
DMBI IIMA 19
SCD – Examples
Product key Description Category SKU Original
Type 1
Product key Description Category SKU
21553 LeadPad Toy LP2105
Type 2
Product key Description Category SKU
21553 LeadPad Education LP2105
44631 LeadPad Toy LP2105
Type 3
Product key Description Category SKU Old category
21553 LeadPad Toy LP2105 Education
DMBI IIMA 20
Dimension Tables: Concept Hierarchy
DMBI IIMA 21
Concept Hierarchies
DMBI IIMA 22
Concept Hierarchies (2)
I New measured facts: add to fact table. If not at the same grain,
then need separate fact table
I Dimension becoming more granular: create new dimension. May
imply more granular fact table, in which case, may have to rebuild
the fact table.
I Addition of a completely new data source involving existing and
new dimensions: usually needs new fact table
DMBI IIMA 25
References
DMBI IIMA 26
THANK YOU