Professional Documents
Culture Documents
Wk3-4 Data Warehouse
Wk3-4 Data Warehouse
Wk3-4 Data Warehouse
data integration
data summarization
chairs 25 37 89 21 172
product
tables 10 30 0 45 85
desks 56 84 9 35 184 Data cube
shelves
19 20 0 71 110
boards 5 16 11 15 47
ALL 115 187 109 187 598
What is a data cube?
• In data warehousing literature, the most detailed part of the
cube is called a base cuboid. The top most 0-D cuboid, which
holds the highest-level of summarization, is called the apex
cuboid. The lattice of cuboids forms a data cube.
tables 10 30 0 45 85
desks 56 84 9 35 184 Data cube
shelves
19 20 0 71 110
boards 5 16 11 15 47
apex cuboid
ALL 115 187 109 187 598
Cube: A Lattice of Cuboids
all
0-D(apex) cuboid
time,location,supplier
time,item,location 3-D cuboids
time,item,supplier item,location,supplier
4-D(base) cuboid
time, item, location, supplier
Conceptual Modeling of Data Warehouses
• The ER model is used for relational database design. For data warehouse
design we need a concise, subject-oriented schema that facilitates data
analysis.
• Modeling data warehouses: dimensions & measures
– Star schema: A fact table in the middle connected to a set of dimension tables
– 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
– Fact constellations: Multiple fact tables share dimension tables, viewed as a
collection of stars, therefore called galaxy schema or fact constellation
Example of Star Schema
time
time_key foreign keys item
day item_key
day_of_the_week Sales Fact Table item_name
month brand
quarter time_key
type
year item_key supplier_type
branch_key
branch location
location_key
branch_key location_key
branch_name units_sold street
branch_type city
dollars_sold province_or_street
country
avg_sales
Measures
Example of Snowflake Schema
time
time_key item
day item_key supplier
day_of_the_week Sales Fact Table item_name supplier_key
month brand supplier_type
time_key type
quarter
year item_key supplier_key
branch_key
location
branch location_key
location_key
branch_key
units_sold street
branch_name
city_key city
branch_type dollars_sold
city_key
avg_sales city
province_or_street
Measures normalization country
time
Example of Fact Constellation
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
Specification of hierarchies
• Schema hierarchy
day < {month < quarter; week}
< year
• Set_grouping hierarchy
{1..10} < inexpensive
Multidimensional Data
• Sales volume as a function of product,
month, and region Dimensions: Product, Location, Time
Hierarchical summarization paths
n
gio
Office Day
total order
Month partial order
(lattice)
A Sample Data Cube
Total annual sales
Date of TV in U.S.A.
1Qtr 2Qtr 3Qtr 4Qtr sum
t
TV
uc
od
PC U.S.A
Pr
VCR
sum
Country
Canada
Mexico
sum
Cuboids Corresponding to the Cube
all
0-D(apex) cuboid
product date country
1-D cuboids
3-D(base) cuboid
product, date, country
DataCube
Browsing a Data Cube
• Visualization
• OLAP capabilities
• Interactive manipulation
Typical OLAP Operations
• Browsing between cuboids
– Roll up (drill-up): summarize data
• by climbing up hierarchy or by reducing a dimension
– Drill down (roll down): reverse of roll-up
• from higher level summary to lower level summary or detailed data, or
introducing new dimensions
• Slice and dice:
– project and select
• Pivot (rotate):
– reorient the cube, visualization, 3D to series of 2D planes.
• Other operations
– drill across: involving (across) more than one fact table
– drill through: through the bottom level of the cube to its back-end relational
tables (using SQL)
Example of operations on a Datacube
C/S S M L TOT
f Red 20 3 5 28
size color Blue 3 3 8 14
Gray 0 0 5 5
TOT 23 6 18 47
color; size
Example of operations on a Datacube
Roll-up:
– In this example we reduce one dimension
– It is possible to climb up one hierarchy
• Example (product, city) (product, country)
C/S S M L TOT
f Red 20 3 5 28
size color Blue 3 3 8 14
Gray 0 0 5 5
TOT 23 6 18 47
color; size
Example of operations on a Datacube
Drill-down
– In this example we add one dimension
– It is possible to climb down one hierarchy
• Example (product, year) (product, month)
C/S S M L TOT
f Red 20 3 5 28
size color Blue 3 3 8 14
Gray 0 0 5 5
TOT 23 6 18 47
color; size
Example of operations on a Datacube
C/S S M L TOT
f Red 20 3 5 28
size color Blue 3 3 8 14
Gray 0 0 5 5
TOT 23 6 18 47
color; size
Example of operations on a Datacube
C/S S M L TOT
f Red 20 3 5 28
size color Blue 3 3 8 14
Gray 0 0 5 5
TOT 23 6 18 47
color; size
A Star-Net Query Model
(contracts,group,district,country,qtrly)
Customer Orders
Shipping Method
Customer
CONTRACTS
AIR-EXPRESS
ORDER
TRUCK
PRODUCT LINE
Time Product
ANNUALY QTRLY DAILY PRODUCT ITEM PRODUCT GROUP
CITY
SALES PERSON
COUNTRY
DISTRICT
REGION
DIVISION
Each circle is called
Location
a footprint Promotion Organization
Data Warehousing and OLAP Technology for Data
Mining
Monitor
OLAP Server
other Metadata &
Integrator
source
s Analysis
Operational Extract Query
Transform Data Serve Reports
DBs
Load
Refresh
Warehouse Data mining
Data Marts
Multi-Tier Data
Warehouse
Distributed
Data Marts