Session 5 - Data Warehousing and OLAP
Session 5 - Data Warehousing and OLAP
Mart Supermarket
The Scenario: X-Mart Supermarket
Problem analysis: X-Mart has different malls in the city, where
daily sales take place for various products. Higher management is
facing an issue of non-availability of integrated data in decision-
making. They cannot do study on their data as per their
requirement. So they would like to design a system, which can
help them in decision-making and provide return on investment.
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
• Need to study trend of sales by time period of the day over the week,
month, and year?
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
The Scenario: X-Mart Supermarket
Functional Requirements Analysis, e.g.:
• Need to see daily, monthly, quarterly profit of each store.
• Need to know which product has more demand on which
location?
• On what day sales is higher?
• What is the trend of sales on weekday and weekend?
• Need to compare daily, monthly and yearly sales to know
growth and KPI?
The Phases Of A Data Warehouse Project
• Design the dimensional model
• Dimension
• Provide filtering, grouping and labeling on data; contains textual
descriptions about the subjects of the business.
• e.g. Product, Customer, Store, etc.
• Measure
• Mapped to a column in a fact table
• e.g.Actual Cost, Total Sales, etc.
• Fact Table
• Provides statistics; usually contains historical transactional entries
of live system
• e.g. [Foreign Key Column] Sales Date key, Store ID, Customer ID,
etc.
[Measures] Total Sales, Quantity, etc.
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
The Schema Design
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
Step 1: Create a new Model
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
Step 2: Create the customer dimension table dim_customer
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
Step 3: Add the customer_id Column to the dim_customer table
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
Step 4: Add the rest of the columns to the dim_customer table
Activity 1:Developing a Data Warehouse for X-
Mart Supermarket
Step 5: Create Store Dimension table dim_store according to the Schema
Add the columns of dim_store as follows: