Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Introduction to Data Warehousing ยท Lesson 6 of 9

Module Five

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
6

Module 5: Data Warehouse Design and Modelling

1. Introduction to Data Warehouse Design

Imagine you own a supermarket with branches in Lagos, Ibadan, and Abuja. Every day, your business collects information about customers, products, sales, payments, and employees.

As the business grows, the amount of information also increases. You need a good way to organise this information so that you can easily find it and use it to make business decisions.

This is where Data Warehouse Design becomes important.

Data warehouse design is the process of planning how information will be organised, stored, connected, and accessed inside a data warehouse.

A good design makes it easier for businesses to:

  • Store large amounts of information.
  • Find information quickly.
  • Create accurate reports.
  • Compare business performance.
  • Understand customers and products.
  • Make better business decisions.

2. Understanding Data Modelling

Data modelling is the process of creating a plan that shows how data will be organised and how different pieces of information are connected.

Think of building a house. Before construction begins, an architect creates a drawing that shows where the rooms, doors, windows, and other parts will be located.

Data modelling works in a similar way. It provides a structure that shows how information should be stored and connected.

Example of Data Modelling

Imagine a supermarket wants to store information about its customers and their purchases.

The business may organise its information into two tables:

Customer Table

Customer ID Customer Name City
101 Ada Lagos
102 John Ibadan
103 Mary Abuja

Sales Table

Sales ID Customer ID Amount (โ‚ฆ)
5001 101 15000
5002 102 20000
5003 101 8000

The Customer ID connects the two tables. This allows the supermarket to identify which customer made each purchase.

3. Types of Data Models

Data modelling is usually discussed at three main levels.

1. Conceptual Data Model

A conceptual data model provides a simple overview of the important information a business needs to store.

It focuses on the main business objects and how they relate to one another. It does not include detailed technical information.

Example: A supermarket may identify these important objects:

  • Customers
  • Products
  • Sales
  • Branches
  • Employees

2. Logical Data Model

A logical data model provides more detail about the information and how different data items are connected.

It may show:

  • Tables or entities.
  • Attributes or fields.
  • Primary keys.
  • Foreign keys.
  • Relationships between tables.

Example: A customer table may contain Customer ID, Customer Name, Phone Number, and City.

3. Physical Data Model

A physical data model explains how information will actually be stored in a database system.

It includes technical details such as:

  • Database table names.
  • Column names.
  • Data types.
  • Indexes.
  • Storage arrangements.

Example: The Customer ID field may be stored as an integer, while the Customer Name field may be stored as VARCHAR(100).

4. Understanding Fact Tables and Dimension Tables

Two important building blocks in dimensional data modelling are Fact Tables and Dimension Tables.

What Is a Fact Table?

A fact table stores measurable business activities or events.

Examples include:

  • Sales amounts.
  • Number of products sold.
  • Payment amounts.
  • Number of orders.
  • Quantity of items purchased.

A fact table usually contains numerical information and keys that connect it to dimension tables.

Example: A supermarket sales fact table may look like this:

Sales ID Customer ID Product ID Quantity Amount (โ‚ฆ)
1 101 201 2 10000
2 102 202 3 15000
3 101 203 1 8000

What Is a Dimension Table?

A dimension table stores descriptive information that helps people understand the facts.

Examples include:

  • Customer names and locations.
  • Product names and categories.
  • Dates and months.
  • Store locations.
  • Employee information.

Example: A product dimension table may look like this:

Product ID Product Name Category
201 Rice Food
202 Milk Drinks
203 Soap Household

Dimension tables provide the details needed to understand and analyse the information in a fact table.

5. Understanding Star Schema

A Star Schema is a common way of organising data in a data warehouse.

It contains one central fact table connected to several dimension tables.

It is called a star schema because the arrangement can look like a star, with the fact table in the centre and dimension tables around it.

Example of a Star Schema

Supermarket Star Schema

Customer

Customer ID

Name

City

Product

Product ID

Name

Category

SALES FACT

Customer ID

Product ID

Date ID

Sales Amount

Quantity

Date

Date ID

Month

Year

Store

Store ID

Branch Name

Location

Note: The dimension tables connect to the central sales fact table through matching keys.

Advantages of Star Schema

  • Easy to understand.
  • Simple to organise.
  • Useful for business reporting.
  • Makes data analysis easier.
  • Supports dashboard development.

6. Understanding Snowflake Schema

A Snowflake Schema is another way of organising data in a data warehouse.

It is similar to a star schema, but some dimension tables are divided into smaller related tables.

For example, instead of keeping all product information in one table, a business may separate product details and product categories into different tables.

Example

A supermarket may organise product information like this:

  • Product Table: Product ID, Product Name, Category ID.
  • Category Table: Category ID, Category Name.
  • Brand Table: Brand ID, Brand Name.

Difference Between Star Schema and Snowflake Schema

Star Schema Snowflake Schema
Uses a central fact table with dimension tables. Uses a central fact table with more divided dimension structures.
Usually has fewer tables. Usually has more tables.
Easier for beginners to understand. Can be more complex to understand.
Often requires fewer joins. May require more joins.

Both designs can be useful. The best choice depends on the organisation's data and reporting needs.

7. Understanding Keys and Relationships

Keys help databases identify records and connect information stored in different tables.

Primary Key

A primary key is a field that uniquely identifies each record in a table.

Example: In a customer table, Customer ID can be used as the primary key because every customer should have a different ID.

Foreign Key

A foreign key is a field in one table that refers to a key in another table. It helps connect related information.

Example: Customer ID in a sales table can refer to Customer ID in the customer table.

Relationships

Relationships explain how records in different tables are connected.

Common database relationships include:

  • One-to-One: One record in a table is connected to one record in another table.
  • One-to-Many: One record is connected to many records in another table.
  • Many-to-Many: Many records in one table can be connected to many records in another table.

Example: One customer can make many purchases. This is a one-to-many relationship between customers and sales.

8. Choosing the Right Data Warehouse Design

Before designing a data warehouse, businesses should understand what they want to achieve.

Some important things to consider include:

  1. Business Needs: What information does the business need to analyse?
  2. Data Size: How much information will the warehouse store?
  3. Data Sources: Where will the information come from?
  4. Performance: How quickly should reports and queries run?
  5. Security: Who should be allowed to access the information?
  6. Future Growth: Can the design support more data as the business expands?

A good design should support the current needs of a business and allow room for future growth.

9. Practical Activity: Design a Simple Sales Warehouse

Imagine you are helping a supermarket with branches in Lagos, Ibadan, and Abuja. The supermarket wants to understand its sales performance.

Your Task

Identify the information the supermarket should store in its data warehouse.

Use the following suggested tables:

1. Customer Dimension

  • Customer ID
  • Customer Name
  • Phone Number
  • City

2. Product Dimension

  • Product ID
  • Product Name
  • Product Category
  • Unit Price

3. Date Dimension

  • Date ID
  • Day
  • Month
  • Year

4. Store Dimension

  • Store ID
  • Branch Name
  • City

5. Sales Fact Table

  • Sales ID
  • Customer ID
  • Product ID
  • Date ID
  • Store ID
  • Quantity Sold
  • Total Sales Amount

Challenge: Explain how the supermarket can use these tables to find its best-selling products, highest-performing branches, and total monthly sales.

10. Important Data Warehouse Design Terms

Term Meaning
Data Warehouse Design Planning how information will be organised and stored.
Data Modelling Creating a plan that shows how data is structured and connected.
Conceptual Model A high-level view of important business information.
Logical Model A detailed description of data structures and relationships.
Physical Model Shows how data is actually stored in a database.
Fact Table Stores measurable business activities.
Dimension Table Stores descriptive information used to analyse facts.
Star Schema A design with a central fact table connected to dimension tables.
Snowflake Schema A design where dimension information is divided into related tables.
Primary Key A field that uniquely identifies a record.
Foreign Key A field that connects one table to another.

11. Module Summary

In this module, you have learned that data warehouse design helps businesses organise information for reporting and analysis.

You have also learned about:

  • Data modelling and its three levels.
  • Fact tables and dimension tables.
  • Star schema and snowflake schema.
  • Primary keys and foreign keys.
  • Relationships between database tables.
  • How to plan a simple sales data warehouse.

Remember: A good data warehouse design makes business information easier to organise, understand, and analyse.

12. Knowledge Check

Answer the following questions to test your understanding.

  1. What is data warehouse design?
  2. What is data modelling?
  3. What are the three levels of data modelling?
  4. What is a fact table?
  5. What is a dimension table?
  6. Why is a star schema called a star schema?
  7. What is the main difference between a star schema and a snowflake schema?
  8. What is a primary key?
  9. What is a foreign key?
  10. Give an example of a one-to-many relationship.

Final Practical Challenge

Imagine you are designing a data warehouse for a Nigerian university.

The university wants to analyse student registrations, examination results, course enrolments, departments, and school fees.

Identify at least four dimension tables and one fact table that could help the university organise this information.

Also explain how the university could use the data warehouse to identify departments with the highest number of registered students.

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’