Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
All rights reserved. No part of this document may be reproduced in any form, or
by any means, without written permission from The Data Warehousing Institute.
ii
TABLE OF CONTENTS
Module 1
1-1
Module 2
2-1
Module 3
3-1
Module 4
4-1
Module 5
5-1
Appendix A
A-1
Exercises
W-1
iii
Module 1
Dimensional Modeling Concepts
Topic
Dimensional Modeling Basics
Page
1-2
1-10
Concepts Summary
1-22
1-1
Logical
Data Model
EMPLOYEE
EMPLOYEE
empl_number
empl_name
empl_gender
empl_length_of_svc
empl_age
TIME
MONTH
JOB
EMPLOYEE SATISFACTION
satisfaction_score
job_turnover_rate
avg_length_of_employ
ment
complaint_frequency
disciplinary_action_fre
quency
date
calendar_year
calendar_month
fiscal_year
fiscal_month
DEPARTMENT
dept_code
dept_name
JOB
job_id
job_description
job_title
job_shift_code
job_location_code
job_status_code
an analysis process
model of business requirements
starting from vague and uncertain
evolving to specific and certain
business questions list & fact/qualifier matrix
Physical
Data Model
location
location_code
location_name
location_address
location_city_name
location_state_abbr
location_zip_code
labor union
union_id_number
union_name
union_group_code
trade
trade_code
trade_SOC_code
trade_name
contract_start_date
contract_end_date
1-8
employee
year
date_yyyy
fiscal_yy
month
date_yyyymm
fiscal_yyyymm
fiscal_yyyyqq
employee satisfaction
job_change_count
employment_length_months
complaint_count
resignation_count
termination_count
promotion_count
demotion_count
disciplinary_action_count
emp_id_number
emp_age
emp_gender
emp_name
emp_hire_date
emp_term_date
emp_status_code
emp_term_reason
department
dept_number
dept_name
dept_abbr
job
job_id_number
job_title
job_shift_code
job_shift_name
CONCEPTUAL
MODELS
LOGICAL MODELS
PHYSICAL MODELS Physical models are produced by technical design processes. They
describe and specify technology solutions. The physical design process
transforms a logical model into a specification for implementation.
Physical modeling adds the details necessary to describe how a product is
structured and assembled. When designing dimensional data, the most
common and widely accepted physical model is a star-schema.
1-9
EMPLOYEE
performs
held by
empl_number
empl_name
empl_gender
empl_hire_date
empl_birth_date
owned by
JOB
job_id
job_description
job_title
job_shift_code
job_location_code
job_status_code
owns
dept_code
dept_name
changed by
PERSONNEL
changes
ACTION
PA_id_number
PA_type_code
PA_effective_date
PA_comments
is
one
of
1-10
DEPARTMENT
hiring
resignation
termination
approval_code
hire_authority_id
resign_reason
voluntary_code
term_authority_code
for_cause_code
1-11
EMPLOYEE
JOB
EMPLOYEE
empl_number
empl_name
empl_gender
empl_length_of_svc
empl_age
TIME
MONTH
date
calendar_year
calendar_month
fiscal_year
fiscal_month
1-12
EMPLOYEE SATISFACTION
satisfaction_score
job_turnover_rate
avg_length_of_employment
complaint_frequency
disciplinary_action_frequency
resignation_rate
termination_rate
promotion_rate
demotion_rate
DEPARTMENT
dept_code
dept_name
JOB
job_id
job_description
job_title
job_shift_code
job_location_code
job_status_code
1-13
Module 2
Requirements Gathering for Dimensional Modeling
Topic
Page
2-2
2-6
Fact/Qualifier Analysis
2-12
2-20
2-1
events / transactions
activities
ce
kfor
r
o
w
product
sources
inputs
s
es es
n
i
s s
bu ces
pro
customers
2-4
Customers
Products
Activities
Workforce
Inputs
Sources
Events
2-5
t,
departmen
y
b
te
a
r
r
e
v
e job turno
and trade?
th
e
g
is
a
t
e
e
a
e
h
y
W
lo
1.
e past thre
er, emp
th
d
r
n
e
e
v
g
o
e
y
e
ll
y
a
ric
emplo
anged histo
h
c
it
s
a
h
How
years?
t?
mploymen
e
f
o
th
g
n
e le
ow
the averag
is
t
a
d shift. Sh
h
n
a
W
,
.
r
2
e
d
n
e
n by age, g
ears.
Break dow th for the past five y
mon
trends by
are filed
ts
in
la
p
m
o
ec
iliation,
y employe
ff
n
a
a
n
m
io
w
n
o
u
H
r
3.
bo
Count by la
?
th
n
o
m
each
epartment.
d
d
n
a
t,
if
h
s
ent,
y departm
b
r
e
v
o
n
r
b tu
om
e rate of jo
th
is
t
a
it change fr
h
s
e
W
o
4.
d
w
o
cation? H
shift, and lo ?
onth
by
month to m
omplaints
c
e
e
y
lo
p
f em
een
equency o
fr
e
th
differ betw
if
is
t
s
a
e
h
o
d
W
.
w
5
ver time?
ice? Ho
o
v
r
d
e
e
s
g
f
n
o
a
h
th
it c
leng
? How has
ts
n
e
m
t
r
a
de p
2-10
2-11
Fact/Qualifier Analysis
Mapping Business Questions
2. What is the average length of employment? Break down by age, gender, and
shift. Show trends by month for the past five years.
3. How many employee complaints are filed each month? Count by labor union
affiliation, shift, and department.
department
employee gender
employee age
trade
year
shift
month
labor union
location
2-16
1,4
1 2
1 2
1
1 2
4 2
4 2
number of complaints
4. What is the rate of job turnover by department, shift, and location? How does
it change from month to month?
3
3
3
Fact/Qualifier Analysis
Mapping Business Questions
EXAMPLE
CONTINUED
2-17
Module 3
Logical Dimensional Modeling
Topic
Page
3-2
Modeling Dimensions
3-4
3-12
3-18
3-1
3-2
1,4
1
1
1
1
4
4
of
department
employee gender
employee age
trade
year
shift
month
labor union
location
length of service
es
ur
as
me
3,5
employee
satisfaction
2
2
2 5
2 3
2 3,5
3
job_turnover_rate
avg_length_of_employment
number_of_complaints
4
5
3-3
Modeling Dimensions
Adding Dimensions from the Qualifiers
labor union
employee
year
emp_age
emp_gender
month
employee
satisfaction
department
job_turnover_rate
avg_length_of_employment
number_of_complaints
shift
location
department
trade
2
2
employee gender
employee age
1
1
trade
year
1
1
shift
month
3
3
labor union
location
3-6
1,4
4
The Data Warehousing Institute
Modeling Dimensions
Adding Dimensions from the Qualifiers
DIMENSIONS IN THE Once dimension hierarchies are known, the logical dimensional model is
extended by adding dimensions and associating them with the meter. For
LOGICAL MODEL
every measure contained in the meter, all associated qualifiers must be
represented by a dimension. To add dimensions to the model:
1. Include each dimension hierarchy previously identified. Associate
only the lowest level of each hierarchy with the meter as a one-tomany relationship.
2. Examine the remaining qualifiers to find those that may be
dimension attributes instead of dimension levels. In this example,
employee gender and employee age are attributes that describe
employee. Thus employee becomes the dimension level, with age and
gender modeled as attributes. The dimension level employee is
associated with the meter as a one-to-many relationship.
3. All remaining qualifiers are mapped as flat (single-level, nonhierarchical) dimensions, and each is associated with the meter using
a one-to-many relationship.
3-7
location
location_code
location_name
location_address
location_city_name
location_state_abbr
location_zip_code
labor union
union_id_number
union_name
union_group_code
trade
trade_code
trade_SOC_code
trade_name
contract_start_date
contract_end_date
3-12
employee
year
date_yyyy
fiscal_yy
month
date_yyyymm
fiscal_yyyymm
fiscal_yyyyqq
employee satisfaction
job_turnover_rate
avg_length_of_employment
number_of_complaints
each in
stan
unique ce represents
combin
a
1 mont
ation o
h, 1 em
f
ploy
1 locat
ion, an ee, 1 job,
d 1 trad
e
emp_id_number
emp_age
emp_gender
emp_name
emp_hire_date
emp_term_date
emp_status_code
emp_term_reason
department
dept_number
dept_name
dept_abbr
job
job_id_number
job_title
job_shift_code
job_shift_name
One month
One employee
One job
One location, and
One trade.
3-13
Module 4
From Logical Model to Star Schema
Topic
Page
4-2
4-10
4-14
4-30
4-1
time
location
location_code
location_name
location_address
location_city_name
location_state_abbr
location_zip_code
location_key
labor organization
union_id_number
union_name
union_group_code
trade_code
trade_SOC_code
trade_name
contract_start_date
contract_end_date
labor_org_key
4-10
date_yyyymm
fiscal_yyyymm
fiscal_yyyyqq
time_key
employee satisfaction
job_change_count
employment_length_months
complaint_count
resignation_count
termination_count
promotion_count
demotion_count
disciplinary_action_count
satisfaction_score
time_key
emp_key
location_key
employment_org_key
labor_org_key
emp_age
emp_gender
employee
emp_id_number
emp_age
emp_gender
emp_name
emp_hire_date
emp_term_date
emp_status_code
emp_term_reason
emp_key
employment
organization
dept_number
dept_name
dept_abbr
job_id_number
job_title
job_shift_code
job_shift_name
employment_org_key
A COMPOSITE KEY
The fact table key is simply the composite of all dimension table keysa
concatenation of dimension surrogate keys. This works well because the
keys are used only for navigation by the OLAP tool and are never
exposed to a business user of the tool.
TABLELESS
DIMENSIONS
Note that the dimensions tables for employee age and gender have been
removed. Once the keys emp_age and emp_gender are migrated into the
fact table, there is no need to maintain them redundantly as single column
tables. It is also acceptable, but not essential, to remove those elements
from the employee dimension table.
4-11
location_code
location_name
location_address
location_city
location_state
00010
NWR001
retail store 1
OR
00020
NWR002
retial store 2
9927 S. Main
OR
00030
NWWHSE
warehouse
Roseburg
OR
location_code
location_name
retail store 1
location_address
location_city
location_state
00010
NWR001
00020
Product Table
September
NWR002
retial store
2
9927 S. 2001
Main Roseburg
OR
00030
NWWHSE
warehouse
OR
00040
NWD001
OR
00050
NWD002
dist. center 2
OR
OR
4-22
Type 2 dimensions insert a new row, with a new surrogate key value, into
the dimension table whenever a change occurs to the value of a dimension
element. This is the most common design choice for slowly changing
dimensions.
The obvious advantage is that a type 2 dimension preserves all of the
history of dimension data changes. For a structure that is also
dimensioned by time, there is no need to time-stamp dimension records.
Each row of the fact table is associated with only one row of each
dimension table, so the time dimension serves as the time stamp.
The most significant disadvantage of type 2 dimensions is rapid growth.
Type 2 dimensions may result in very large dimension tables,
contributing to both database size and query performance concerns.
4-23
business
requirements
dimensional
modeling
logical
dimensional
modeling
model the
dimensions
refine
the meter
physical
dimensional
modeling
4-30
4-31
Module 5
Dimensional Data and Business Analytics
Topic
Page
5-2
An OLAP Demonstration
5-4
5-1
An OLAP Demonstration
Business Metrics in Action
time
location
location_code
location_name
location_address
location_city_name
location_state_abbr
location_zip_code
location_key
labor organization
union_id_number
union_name
union_group_code
trade_code
trade_SOC_code
trade_name
contract_start_date
contract_end_date
labor_org_key
5-4
date_yyyymm
fiscal_yyyymm
fiscal_yyyyqq
time_key
employee satisfaction
job_change_count
employment_length_months
complaint_count
resignation_count
termination_count
promotion_count
demotion_count
disciplinary_action_count
satisfaction_score
employee_count
time_key
emp_key
location_key
employment_org_key
labor_org_key
emp_age
emp_gender
employee
emp_id_number
emp_age
emp_gender
emp_name
emp_hire_date
emp_term_date
emp_status_code
emp_term_reason
emp_key
employment
organization
dept_number
dept_name
dept_abbr
job_id_number
job_title
job_shift_code
job_shift_name
employment_org_key
An OLAP Demonstration
Business Metrics in Action
OLAP DEMO
NOTES
5-5
Exercises
Exercises
Exercise Instructions and Worksheets
Topic
Exercise 1: Relational or Dimensional?
W-2
W-4
W-6
W-8
Page
W-10
W-1
Exercises
W-4