Subject: Data Processing
Note for SS 2 – Data Models Part 1
1. Definition of Data Model
A data model is a conceptual representation of how data elements are organized, related,
and stored in a database system. It defines the structure of the database and how data can
be accessed and manipulated.
In simpler terms: A data model shows how data is connected to each other and how it can
be processed and stored inside a database.
Example: In a school database, the data model may show that each student has a name,
class, subjects, and results, and that each subject belongs to a teacher.
2. Importance of Data Models in Database Design
Provide a clear structure – They help database designers understand how data is
organized.
Improve communication – They make it easier for programmers, users, and designers to
discuss how data will be used.
Ensure data consistency – They reduce errors and duplication of data.
Guide database creation – They serve as a blueprint for building the database.
Support data integration – They make combining data from different sources easier.
3. Types of Data Models
There are three major types of data models used in database design:
a. Hierarchical Data Model
Organizes data in a tree-like structure. Each record has a single parent, and may have
multiple children. Relationship type: One-to-many (1:M). Example: A school database where
one teacher teaches many students.
Advantages:
Simple and fast for one-to-many relationships.
Disadvantages:
Difficult to modify or add new relationships.
b. Network Data Model
Organizes data as records connected by links or relationships. A record can have multiple
parents and multiple children. Relationship type: Many-to-many (M:N). Example: A student
can take many subjects, and each subject can have many students.
Advantages:
Flexible connections.
Disadvantages:
Complex to design and maintain.
c. Relational Data Model
Organizes data in tables (relations) made up of rows and columns. Each table represents an
entity (e.g., Student, Teacher, Subject). Relationships are established using keys (Primary
key, Foreign key). Example: In a student database, a StudentID links students to their
results.
Advantages:
Simple, flexible, and widely used.
Disadvantages:
Can be slow with very large databases.
4. Summary
- A data model describes how data is organized, related, and stored in a database.
- It is important for database design, communication, and consistency.
- Types of data models: Hierarchical, Network, and Relational.
5. Evaluation / Assessment
1. Define a data model.
2. List three importance of data models.
3. Name and explain the three types of data models.
4. Which data model organizes data in tables?
5. What is the main disadvantage of the hierarchical data model?
6. Assignment
6. Draw a simple diagram of a hierarchical data model showing 'Principal → Teachers →
Students'.
7. Explain the difference between network and relational data models.