13
8/8/2019 An Introduction to Dimensional Data Warehousing Design http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 1/13 An Introduction to Dimensional Data Warehouse Design Presented by Joseph J. Sarna Jr. JJS Systems, LLC

An Introduction to Dimensional Data Warehousing Design

Embed Size (px)

Citation preview

Page 1: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 1/13

An Introduction to Dimensional DataWarehouse Design

Presented by

Joseph J. Sarna Jr.

JJS Systems, LLC

Page 2: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 2/13

Relational Normal Form

Most relational databases are set to 3rd normal form

1st Normal form ± Tables have unique keys and no repeating

groups or multi-value fields

2nd Normal form ± Every attribute is dependent ont the entire

key of the table

3rd Normal form ± Attributes are dependent only on the key.No derived elements

Page 3: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 3/13

Northwind Database Model ± Relational Format

Categories

PK CategoryID

I1 CategoryName

Description

Picture

Territories

PK TerritoryID

TerritoryDescription

FK1 RegionID

Products

PK ProductID

I3 P ro du ctN am e

FK2,I4,I5 SupplierID

FK1,I2,I1 CategoryID

QuantityPerUnit

UnitPrice

UnitsInStock

UnitsOnOrder 

ReorderLevel

Discontinued

CustomerCustomerDemo

PK,FK2 CustomerID

PK,FK1 CustomerTypeID

CustomerDemographics

PK CustomerTypeID

CustomerDesc

EmployeeTerritories

FK2 TerritoryID

FK1 EmployeeID

Customers

PK CustomerID

I2 CompanyName

ContactName

ContactTitle

 Address

I1 City

I4 Region

I3 PostalCode

Country

Phone

Fax

Region

PK RegionID

RegionDescription

Order Details

PK,FK1,I2,I1 OrderID

PK,FK2,I4,I3 ProductID

UnitPrice

QuantityDiscount

Shippers

PK ShipperID

CompanyName

Phone

Orders

PK OrderID

FK1,I1,I2 CustomerID

FK2,I4,I3 EmployeeID

I5 OrderDate

RequiredDateI6 S hippedDate

FK3,I7 ShipVia

Freight

ShipName

ShipAddress

ShipCity

ShipRegion

I 8 S hi pP os ta lC od e

ShipCountry

Suppliers

PK SupplierID

I1 CompanyName

ContactName

ContactTitle

 Address

City

Region

I2 PostalCode

Country

Phone

FaxHomePage

Employees

PK EmployeeID

I1 LastName

FirstName

Title

TitleOfCourtesy

BirthDate

HireDate

 Address

City

Region

I2 Pos ta lCode

Country

HomePhone

Extension

PhotoNotes

FK1 ReportsTo

PhotoPath

Page 4: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 4/13

Why Dimensional Data Warehouses?

Business needs to analyze data so that it can:

 ± Understand trends

 ± Predict future behavior and needs

 ± Personalize contact with customers

 ± Be competitive

All of this in a speedy manner, with the ability to do³What if¶s´

Page 5: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 5/13

Drawbacks to Relational Data Structures

Data is not structured for analytical usage

Multiple Joins are resource intensive

Missing data from external sources, context history, not

operational sources

Page 6: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 6/13

What Is a Dimensional Data Warehouse?

³A structured repository of validated and integrated

historical information accessible to business people to

provide the basis for both tactical and strategic

business decisions.´

Centralized extract and staging

Separate from operational system

Structured for analysis Historically contexted

Page 7: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 7/13

Dimensional Data Warehouse Architecture

Relational Data External Data Enterprise Data

Data DistributionAcquisition, Staging, Cleaning,

Transformation

Data Warehouse

Storage

Analytical

Applications

Page 8: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 8/13

Levels of Design

Detail Level

 ± Dimensional Normal form

 ± Value and feasibility

Analytical Level

 ± Structured for the required analyses

Summary Level ± Summaries for user requirements

 ± Better response time

Page 9: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 9/13

Dimensional Normal Form

Normalized for maintainability

De-normalized for performance, based on rules

2 level structure, therefore only one level of joins

required for queries

Page 10: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 10/13

Northwind Database Model ± Dimensional Format

Ca t ¡ ¢ 

ri 

s

P£ ¤ 

at e¥ 

or ¦ £ 

e ¦ 

Ca t ¡ ¢ 

r §  I ̈

Ca t ¡ ¢ 

r § © 

am e

De scri 

ti¢ 

 

 

ict 

r e

Te rrit¢ 

rie s

P£  

erritor ¦ 

£ 

e¦ 

 

1 R eg i¢ 

 

ey

Te rrit¢ 

r yID

Te rrit¢ 

r yD escri 

ti¢ 

 

 

r ¢ 

 

 

cts

P£ 

Prod  

 

t£ 

e ¦ 

 

r ¢  

 

ctI D

P r ¢ 

 

 

ct© 

am e

Q u a n tityP er  

n it

 

n itP ric e

Un itsInS t¢ 

ck

Un its! 

nO r  

e r 

R eo r  

er " 

ev e l

D isc on tin u e d

FK 1 Ca teg or yK ey

Ca teg or yID

Ca teg or y N a m e

De scri 

tion

F K2 S u pp lie r Ke y

S upp lie rID

C o m p a n y N a m e

Co n ta ctN a m e

Co n ta ctTitle

 Add r ess

C ity

R eg ion

Po sta lC o d e

C o u ntr y

P h o n e

Fa x

H o m e P a g e

Cu stom er Cu stom er D e m o

P£ ¤ 

  stomerDemo¥ 

ra# 

hi 

s£ 

e ¦ 

Cu stom er Ke y

FK 1 Cu stom erT ypeK ey

Cu stom er De sc

Cu st om e r D e m o gr ap h ics

P£ ¤ 

  stomer  

¦ 

e£ 

e ¦ 

Cu st om e rT yp e ID

Cu st om e r De sc

mp loyee Te rritori es

P£ % 

m# 

lo¦ 

ee 

erritor ¦ 

£ 

e¦ 

FK 1$ 

mp loyeeK ey

FK 2 Te rrito r yK ey

Te rrito r yID

Te rrito r yD escrip tion

Reg io n K e y

Reg ion ID

Reg io n D escrip tion

Cu st om e rs

P£ ¤ 

  stomer £ 

e ¦ 

Cu stom e rIDC o m p a n y N a m e

Co n tactN a m e

Co n tactTitle Add r e ssC ity

R eg ion

Po st a lC o d eC o u n tr y

P h o n e

Fa x

Cu stom e rT yp e IDCu stom e r De sc

FK 1 Cu stom e r D e m o gr ap h ics Ke y

R eg ion

P£ 

Re¥ 

ion£ 

e ¦ 

R eg ion ID

R eg io n D escrip tion

Sh ipp ers

P£ & 

hi# # 

er £ 

e ¦ 

Sh ipp e rID

C o m p a n y N a m e

P h o n e

O r de rs

P£ 

Order £ 

e¦ 

O r de rID

FK 1 Cu stom er Ke y

F K2 E mp loyee ID

F K3 S hipp er Ke y

O r de r Da te

R eq u ir e d D a te

Sh ip p e d D ate

F r e igh t

Sh ip N a m e

Sh ipA dd r ess

Sh ipC itySh ipR eg ion

Sh ipP ost a lC o d e

Sh ip C o u ntr y

Em p loyee s

P£ % 

m# 

lo ¦  ee£ 

e ¦ 

Em p loyee ID

La stN a m e

F irstN a m e

Title

TitleO f Co urte sy

B irt hD a te

H ir eD a te

 Add r ess

C ity

R eg ion

Po sta lC o d e

C o u ntr y

H o m e P h o n e

Ex ten si on

Ph o toNo tes

FK 1 R ep ortsTo

Ph o toP a th

Em p loyee Te rrito r yK ey

Territor yK ey

Territor yID

Territor yD e scrip tion

R eg io n K e y

R eg ion ID

R eg io n D escrip tion

S u p pliers

P£ & 

 

# # 

lier £ 

e¦ 

S u p plie rID

C o m p a n y N a m e

Co n ta ctN a m e

Co n ta ctTitle Add r ess

C ity

R eg ion

Po sta lC o d eC o u ntr y

P h o n e

Fa xH o m e P a g e

O r de r De ta ils

P£ 

OrderDetai l£ 

e¦ 

F£ 

2 O rder  £ 

e¦ 

O r de rID

Un itP ric e

Q u a n tity

D isc ou n t

Ex tendedP ric e

FK 1 P r od uct Ke y

P r od uctI D

P r od uct N a m eQ u a n tityP er Un it

Un itP ric e

Un itsInS to ck

Un its On O r de r R eo r de r Leve l

D isc on tin u e d

Ca teg or yK ey

Ca teg or yIDCa teg or y N a m e

De scrip tion

S u p plie r Ke yS u p plie rID

C o m p a n y N a m e

Co n ta ctN a m e

Co n tactTitle Add r ess

C ity

R eg ion

Po sta lC o d eC o u ntr y

P h o n e

Fa xH o m e P a g e

Page 11: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 11/13

Dimensional Schema

Fact Tables

 ± contain related measures

 ± Usually the largest tables

 ± Usually appended to ± Can contain detail or summary data

 ± Measures are usually additive

Dimension Tables

 ± Contain descriptors

 ± Utilize business terminology

 ± Textual and discrete data

 ± Attributes through which the table measures are analyzed

Page 12: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 12/13

Northwind Database ± Star Schema ± rders

d im C u sto m e rs

K C u s to m er K e y

C u sto m e rID

C o m p a n yN a m e

C o n ta ctN a m e

C o n ta ctT itle

 A d d re s s

C ity

R e g io n

P o sta lC o d e

C o u n try

P h o n e

F a x

C u st o m e rT yp e ID

C u sto m e rD e sc

d im S h ip p e rs

P K S h ip p e rK e y

S h i p p e r I D

C o m p a n yN a m e

P h o n e

fctO rd e rs

K( 

r d e r K e y

F K 3 P ro d u ctK e y

F K 2 E m p lo ye e K e y

F K 1 C u sto m e rK e y

F K 4 S h ip p e rK e y

F K 6 O rd e rD a te K e y

F K 5 R e q u ire d D a te K e y

F K 7 S h ip p e d D a te K e y

O rd e rIDS h ip V ia

F re ig h t

S h ip N a m e

S h ip A d d re ss

S h ip C ity

S h ip R e g io n

S h ip P o st a lC o d e

S h ip C o u n try

d im E m p lo y e e s

K E m p lo ye e K e y

E m p lo ye e ID

L a stN a m e

F irst N a m e

T itle

T itle O fC o u rte sy

B irth D a te

H ire D a te

 A d d re ss

C ityR e g io n

P o sta lC o d e

C o u n try

H o m e P h o n e

E xt e n sio n

P h o to

N o te s

R e p o rtsT o

P h o to P a th

T e r r i to ryID

T e rrit o ryD e sc rip tio n

R e g io n ID

R e g io n D e scri p tio n

d im O rd e rD e ta ils

'  K '  r o d u c t K e y

O rd e rID

U n itP ric e

Q u a n tity

D isc o u n t

E xt e n d e d P ric e

P ro d u ctID

P ro d u ctN a m e

Q u a n tit yP e rU n it

U n itP ric e

U n itsIn S to ck

U n its O n O rd e r 

R e o rd e rL e ve l

D is co n tin u e d

C a te g o ryIDC a te g o ry N a m e

D e scr ip tio n

S u p p lie rID

C o m p a n yN a m e

C o n ta ctN a m e

C o n ta ctT itle

 A d d re ss

C ity

R e g io n

P o sta lC o d e

C o u n try

P h o n e

F a x

H o m e P a g e

d im D a te

K D ate K ey

D a yD a te

D a yD a te _ Y Y Y Y M M D D

D a yO fW e e kN a m e

D a yO f W e e kN a m e A b b rv

D a yN u m b e rIn W e e k

D a yN u m b e rIn M o n th

D a yN u m b e rIn Q u a rte

D a y N u m b e rIn Y e a r 

W e e kD a yI n d ica to r 

W e e kE n d In d ica to r 

W e e k_ Y Y Y Y W W

W e e k N u m b e rIn Y e a r 

M o n th _ Y Y Y Y M M

M o n th N a m e

M o n th N a m e A b b rv

M o n th N u m b e rIn Y e a r 

Q u a rte r_ Y Y Y Y QQ u a rte rN a m e

Q u a rte r N a m e A b rv

Q u a rte r N u m b e rIn Y e a r 

Y e a r 

Page 13: An Introduction to Dimensional Data Warehousing Design

8/8/2019 An Introduction to Dimensional Data Warehousing Design

http://slidepdf.com/reader/full/an-introduction-to-dimensional-data-warehousing-design 13/13

Resources

Books

 ± The Data Warehouse Toolkit, Ralph Kimball

 ± The Data Warehouse Lifecycle Toolkit, Ralph Kimball, et al

 ± Data Warehouse Design Solutions, Adamson / Venerable

Websites

 ± http://www.ralphkimball.com/

² http://www.atre.com

² http://www.microsoft.com/sql/evaluation/overview/dataware.asp