🧠 DATABASE MODELS – Complete Notes
📘 1. Introduction to Database Models
A Database Model defines the logical structure of a database — i.e., how data is stored,
connected, and accessed.
It tells:
What entities (tables) exist
How they relate to each other
What rules apply to data
🧩 2. Types of Database Models
1. Hierarchical Model
2. Network Model
3. Relational Model
4. Entity-Relationship (ER) Model
5. Object-Oriented Model
6. Object-Relational Model
7. NoSQL (Non-Relational) Models
3. Hierarchical Model
🔹 Structure:
Data is organized in a tree-like structure (parent-child relationship).
Each child record has only one parent, but one parent may have multiple children.
🔹 Example:
Company
├── Department
│ ├── Employee
│ └── Project
🔹 Advantages:
Fast data retrieval
Simple structure
Data integrity (through hierarchy)
🔹 Limitations:
Difficult to modify structure
No many-to-many relationship
Redundant data
🔹 Example System:
IBM IMS (Information Management System)
🌐 4. Network Model
🔹 Structure:
Data represented as graph — records connected by links (pointers).
Each record can have multiple parents and children.
🔹 Example:
Student → EnrolledIn → Course
Course → TaughtBy → Teacher
🔹 Advantages:
Supports many-to-many relationships
Flexible connections
Faster access through pointers
🔹 Limitations:
Complex structure
Difficult to design and maintain
Programmer-dependent navigation
🔹 Example System:
CODASYL DBTG Model
📊 5. Relational Model
(Introduced by E.F. Codd, 1970)
🔹 Structure:
Data is stored in tables (relations), each having rows (tuples) and columns (attributes).
🔹 Example Table: STUDENT
RollNo Name Program CGPA
1 Ali BSCS 3.5
2 Sana BSIT 3.2
🔹 Key Concepts:
Primary Key → uniquely identifies each row
Foreign Key → references another table
Relation = Table
🔹 Advantages:
Simplicity
Data independence
Powerful query language (SQL)
Reduced redundancy
🔹 Limitations:
Slower for complex data (images, multimedia)
Limited support for complex relationships
🔹 Example Systems:
MySQL, Oracle, SQL Server, PostgreSQL
🧱 6. Entity-Relationship (ER) Model
🔹 Structure:
Graphical representation of real-world entities and relationships.
🔹 Components:
Entity → Object (e.g., Student, Course)
Attribute → Properties (e.g., Name, Age)
Relationship → Association (e.g., Student enrolls in Course)
🔹 ER Diagram Symbols:
Concept Symbol
Entity Rectangle
Attribute Oval
Relationship Diamond
Primary Key Underline
Multivalued Attribute Double Oval
🔹 Example:
STUDENT —(Enrolls)— COURSE
🔹 Advantages:
Conceptual simplicity
Useful for database design
Basis for relational schema
🧩 7. Object-Oriented Model
🔹 Structure:
Data represented as objects similar to programming languages like C++ or Java.
Each object = data + behavior (methods).
🔹 Features:
Encapsulation
Inheritance
Polymorphism
🔹 Example:
Class Student {
RollNo, Name, CGPA;
Method: calculateGPA();
}
🔹 Advantages:
Handles complex data (e.g., multimedia)
Reusability and extensibility
🔹 Limitations:
Complex to implement
Limited tools and query languages
🔹 Example Systems:
db4o, ObjectStore, Versant
8. Object-Relational Model (Hybrid Model)
🔹 Definition:
Combines relational and object-oriented features — stores complex data in relational tables.
🔹 Example:
PostgreSQL supports:
User-defined data types
Methods/functions
Inheritance in tables
🔹 Advantages:
Best of both worlds
Supports multimedia, arrays, JSON data
🔹 Limitation:
Increased complexity
Slower than pure relational for simple data
🌍 9. NoSQL (Non-Relational) Models
Designed for big data and unstructured data.
🔹 Types:
1. Document-based (MongoDB)
2. Key-Value (Redis)
3. Column-based (Cassandra)
4. Graph-based (Neo4j)
🔹 Features:
Schema-less
High scalability
Fast for large-scale data
🔹 Example:
MongoDB Document:
{ "Name": "Ali", "Course": "DBMS", "Marks": 95 }
🧮 10. Comparison of Database Models
Model Structure Relationship Example Advantages Limitations
Hierarchical Tree One-to-Many IMS Simple, Fast Rigid, Redundant
Network Graph Many-to-Many CODASYL Flexible Complex
Relational Table Key-based MySQL Simple, SQL Limited complex data
ER Diagram Conceptual Oracle Design Visual Not for storage
Object-Oriented Object Inheritance db4o Complex data Complex system
Object-Relational Hybrid Mixed PostgreSQL Advanced Slow
NoSQL Document Dynamic MongoDB Scalable No standards
🧠 11. Evolution of Models
Generation Model Type Period
1st File-based Systems 1950s–1960s
2nd Hierarchical & Network 1960s–1970s
3rd Relational Model 1970s–1990s
4th Object-Oriented & Object-Relational 1990s–2000s
5th NoSQL & NewSQL 2000s–Present