Documente Academic
Documente Profesional
Documente Cultură
2
a) In line with a data warehouse being subject-oriented, using the
above scenario, identify what the "key focus" of this data warehouse
application should be.
b) Identify all the dimensions for the data warehouse application.
Considering your answer from question (a), identify at least 2 facts (or
measures) that will be contained in the fact table. (NOTE: Any
assumptions should be clearly stated.
c) Draw a simple star schema for the above data warehouse showing
only the primary key-foreign key relationships.
3
Dimensional Data Modelling
1. Date and Time dimensions
2. Degenerate Dimensions
3. Slowly Changing Dimensions (SCD)
4. Aggregate Fact tables
5. Three main types of fact tables.
6. Developing dimensional data models using iterative
process.
Date Dimensions
The date dimension is very important for every fact table as
facts are a sequence of observations.
Order Fact
Time Dim Customer
DateKey
TimeKey ProductKey CustomerKey
IsMorning CustomerKey Code
IsAfternoon TimeKey FirstName
IsEvening ….
…
Degenerate Dimensions
What are degenerate dimensions?
15
Type 2: Add a new dimension row:
For example:
daily sale transactions for thousands of products will
increase by number of product sales per day.
Payment Type
Fact Sale Transaction
Customer
Register Promotion
Outlet
Identify attributes of dimensions and measures of the
central fact table
30
1. The following table form part of a database held in a relational DBMS.
Hotel (hotelNo, hotelName, City)
Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, datefrom, dateTo, roomNo)
Guest (guestNo, guestName, guestAddress, guestcardNo,
expiryDate)
31
32
33
Solution of No. 2
34
35
1. Understanding of Data Sources using Profiling techniques.
36
Understanding of Data Sources
It should include :
Steps:
For each dimension and fact table
- Define columns and identify primary keys.
- Identify data types of each column.
- Build a source to target mapping for each column.
Implementing a Data Warehouse
Furniture
Customer
Sales
Dat
e
Identify attributes of Dimensions and Measures of the Central
Fact Table:
Date Dim Customer Dim
DateKey CustomerKey
Sales Fact Name Gender
Date
Name BirthDate City
DateKey Region
WeekNumber FurnitureKey
MonthNumber State
CustomerKey
MonthName Quantity
Quarter Income
Year Discount
Furniture Dim
FurnitureKey
Type Category
Material
Build Detailed Designs of Dimension
and Fact Tables:
SQL command to
create a date
dimension table.
CREATE TABLE
dbo.CustomerDim( CustomerKey i n t
IDENTITY(1,1) NOT NULL, Name
varchar(50) NOT NULL,
Gender char(1) NOT NULL,
BirthDate date NOT NULL,
City varchar(50) Not
NULL,
Regional varchar(50) NOT NULL,
State varchar(50) NOT NULL
) ON [PRIMARY];
GO