Professional Documents
Culture Documents
Data Modeling
Data Modeling
Data Modeling refers to the process of creating relationships between multiple tables based on a
common field (column). Its primary purpose is to structure data in a way that supports efficient
querying and analysis.
1. Dimension Table
2. Fact Table
• Dimension tables are also known as parent tables, primary key tables, or master tables.
• They are referred to as parent tables because their columns are used as references by child
tables to maintain data integrity.
• These tables are considered master tables because they contain unique records, with each
record occurring only once.
• Example: In a sales database, a "Products" dimension table contains unique product
information, and a "Customers" dimension table contains unique customer details.
To create an effective data model, dimension tables and fact tables need to be connected in specific
ways, commonly achieved through two schema designs:
1. Star Schema
2. Snowflake Schema
i. Star Schema:
• The star schema design is named for its resemblance to a star.
• It is the most popular and preferred design due to its simplicity and ease of use.
• In a star schema, the fact table is directly connected to dimension tables.
• Example: In a retail database, the "Sales" fact table is connected to dimension tables like
“Date”, "Products", "Employee", “SalesTerritory”, and “Reseller”.
i. 1-to-Many Relationship:
• This relationship is established between a dimension table and a fact table.
• It's named 1-to-Many because each record in the dimension table has a single occurrence,
while the fact table contains multiple occurrences of related data.
• Example: In a university database, the "Students" dimension table has a 1-to-Many
relationship with the "Courses" fact table because each student can enrol in multiple courses.