Data Modeling For Business Intelligence: Lesson 4: Logical Model
Data Modeling For Business Intelligence: Lesson 4: Logical Model
Data Modeling For Business Intelligence: Lesson 4: Logical Model
Business
Intelligence
Lesson 4: Logical Model
Lesson Objectives
2
4.1: Introduction
3
4.2: Features of a Logical Model
4
4.3: Requisite Transformations
Transformation Required
Transformations
Primary Foreign
Table Column
Key Key
Specification Specification
Specification Specification
5
4.3: Table Specification
6
4.4: Types of Relationships
10
4.4: Types of Relationships
11
4.4: Types of Relationships
Many-to-Many Relationship
12
4.4: Types of Relationships
EMPLOYEE PROJECT
has
(Association)
13
4.5: Logical Model an Example
14
Exercise 1
Scenario
Industry: Automobile manufacturing
Company: Millennium Motors
Value chain focus: Sales
Sample business questions:
What are the top 10 selling car models this month?
How do this months top 10 selling models compare to the top 10 over the last six
months?
Show me dealer sales by region by model by day
What is the total number of cars sold by month by dealer by state?
List facts and dimensions
15
Exercise 1 Solution
Facts
Sales revenue
Quantity sold
Dimensions
Model name
Month
Dealer name
Region
State
Date
16
Example Fact Table
Sales Facts
model_key
dealer_key
time_key
revenue
quantity
17
Example Fact Table Records
Sales Facts
time_key model_key dealer_keyrevenue quantity
1 1 1 75840.27 2
1 2 1 152260.37 3
1 3 1 28360.15 1
1 4 1 132675.22 4
1 5 1 43789.45 1
1 1 2 35678.98 1
1 3 2 57864.78 2
1 5 2 92876.67 2
18
Facts
Fully additive
Can be summed across any and all dimensions
Stored in fact table
Time
Examples: revenue, quantity time_key
year
Model
Sales Facts quarter
model_key
model_key month
dealer_key date
brand
category time_key
line
model revenue
quantity
Dealer
dealer_key
region
State city dealer
19
Facts
Semi-additive
Can be summed across most dimensions but not all
Examples: Inventory quantities, account balances, or personnel counts
Anything that measures a level
Must be careful with ad-hoc reporting
Often aggregated across the forbidden dimension by averaging
Time
Model Sales Facts
time_key
model_key model_key
year
brand dealer_key
quarter
category time_key
month
line
date
model inventory
Dealer
dealer_key region
State city dealer
20
Facts
Non-Additive
Cannot be summed across any dimension
All ratios are non-additive
Break down to fully additive components, store them in fact table
Model Sales Facts time_key Time
model_key model_key
dealer_key year
time_key quarter
brand
month
category
revenue date
line
model margin_amt Dealer
dealer_key
region
Margin_rate is non-additive State city
Margin_rate = margin_amt/revenue dealer
21
Unit Amounts
22
Example Dimension Table Records
Dealer Dimension
23
Dimension Tables
Characteristics
Hold the dimensional attributes
Usually have a large number of attributes (wide)
Add flags and indicators that make it easy to perform specific types of reports
Have small number of rows in comparison to fact tables (most of the time)
Dont normalize dimension table
Saves very little space
Impacts performance
Can confuse matters when multiple hierarchies exist
A star schema with normalized dimensions is called a "snowflake schema"
Usually advocated by software vendors whose product require snowflake for
performance
24
4.6: Logical Model
Entity Names
Entity Relationships
Attributes
Primary Keys
Foreign Keys
Table Names
Column Names
25
Data modeling TOOLS
26
Summary
27
Review Question
28