Introduction
• What isa Data Model ?
• Model :- is a simple representation of something real .
• It's helps us understand , expalin , or predict how things
work .
• Data Model :- is a way to simple representation & to
organize data structure .
• Data models helps how data is arranged and connected .
• Today here we will discuss about Hierarchical Model,
Network Model & OOPS Model.
3.
Hierarchical Model
• Itwas the first DBMS Model.
• This model organises the data in the hierarchical tree structure.
• It is a tree-like structure where data is organized in parent-
child relationships.
• Data is stroed as records connected through links.
• Starts from Root.
• One parent can have many children , but each child has only one
parent.
• One to many relationship in hierarchical model.
4.
Example :
• Asshown in above image:
• Department is root node which is top most parent node,
• Course and Student are child nodes of Department.
• & Professor appears under course , so it's a child node of course.
5.
Pros and Cons
•Pros:
• Hierarchical model is simple and easy to understand
• Retrieval of data is simple as if it is accessed in top down
approach
• Cons:
• Hard to reorganize or add new relationship.
• Data duplication is common of this model as it doesn’t support
many to many relationship.
• When you changes in structures then also require changes in
all nodes.
6.
Network Model
• Networkmodel was invented by Charles Bachman and it
was developed into a standard specification published in
1969 by CODASYL
• Network model organises data in the form of graph-like
structure, allow to represent complex many to many
relationship between records
• It is an extension of hierarchical model to overcome its
limitation of one to many relationship.
• In network model pointers are used to link one node to
another node.
7.
Example
• As shownin above image:
• University has two department Mathematics & Computer Science
• Both department can access Library and Computer lab
• Both department can have a faculty who can teach in both
8.
Pros and Cons:
•Pros:
• This type of model handles complex relationships easily as it
supports many-to-many relationships.
• Data access is comparatively faster than hierarchical model due
to multiple paths between the nodes.
• Cons:
• Network model are very complex and difficult to understand
because the use of pointers
• Navigating the network model can be difficult to whom who
are unfamiliar to Database.
9.
Object Oriented Model
•An Object-Oriented Database is a type of database that store
data in the form of objects, just like in object-
oriented programming.
• Instead of storing data in the tables like relational databases,
it organizes data as object, which include both data(attributes)
and methods(functions).
• These objects are organized and stored in a way that
reflects the relationships and structures found in the real world.
• The main focus is to minimize the difference between a
database structure and a programming language.
10.
Example of anobject-Oriented Database
Imagine a Garage Management System Database :-
Instead of using tables, an OODBMS stores cars as objects with
attributes(data) and Methods(functions).
Car Object:
• Attributes:
• Brand: "Toyota"
• Model: "Fortuner"
• Year: 2023
• Methods:
• start(): Starts the car.
• stop(): Stops the car.
• carPrice(): Returns the car’s price.
• You can directly call methods like car.start() to start the car
• The database stores not just the data (e.g., Brand = "Toyota") but also the behavior (e.g.,
the start() method’s logic).
11.
Key Concepts inOODBMS
• Class is a schema or blueprint that defines object structure and behavior.
• Object is the basic building block and an instance of a class. It can either built-in or user-
defined.
1. Encapsulation
• Definition: Combines data and actions in an object, hiding internal details.
• Example: A Car object has:
• Attributes: Brand = "Toyota", Model = "Fortuner", Year = 2023
• Methods: start(), stop()
• You call car.start() without knowing how the engine works.
• Benefit: Keeps data secure and simplifies usage.
2. Inheritance
• Definition: A new class reuses attributes and methods from an existing class.
• Example: A SportsCar class inherits from Car:
• Gets Brand, Model, Year, start(), stop().
• Adds topSpeed and boost().
• Benefit: Saves time and supports specialized objects.
12.
3. Polymorphism
• Definition:Different objects use the same method name but behave
differently.
• Example: carPrice() method:
• For a Toyota Fortuner (Car): Returns 30,00,000.
• For a BMW (SportsCar): Returns 60,00,000 with extra features.
• Benefit: Makes the system flexible for different object types.
4. Abstraction
• Definition: Hides complex details, showing only essential features.
• Example: A Mechanic object has repairCar(). You
call mechanic.repairCar(car) without knowing the repair process.
• Benefit: Simplifies interactions with complex objects.
13.
Pros and Cons
•Pros:
• OODBMS excels at representing complex, real-world entities with rich
relationships and behaviors, allowing for a more natural mapping
between application objects and database objects.
• The principles of object-oriented programming like inheritance and
encapsulation are directly applied to the database, promoting code
reusability and modularity in data definitions and operations.
• Cons:
• OODBMS is not as widely adopted as relational databases, leading to a
smaller community, fewer resources, and a lack of widely accepted
standards
• Integrating OODBMS with existing systems and tools designed for
relational databases can be complex due to the differences in data
models and query languages.
14.
Comparison
Feature Hierarchical ModelNetwork Model Relational Model
Structure Tree-like (Parent-Child)
Graph-like (Many-to-
Many)
Table-based (Rows
and Columns)
Data Relationship One-to-many only
Many-to-many
allowed
Many-to-many
through keys
Flexibility Less flexible
More flexible than
hierarchical
Most flexible
Ease of Use Complex to manage
More complex than
hierarchical
Easy to use and
understand
Data Access
Navigational (via
parent to child)
Navigational (via links
or pointers)
SQL-based (Easy and
ad-hoc queries)
Redundancy More redundancy Less than hierarchical
Minimal redundancy
due to normalization
Example
XML structure, File
systems
Telecom, Airline
reservation systems
MySQL, Oracle,
PostgreSQL
15.
Conclusion
• Each modelfits different use cases
• Hierarchical is simple but rigid suits when data fits tree
structure
• Network model offers flexibility.
• Object-Oriented Model is modern, real-world friendly, and
ideal for complex systems with reusable components.
• Hierarchical and Network were base for early DBs.
• OOPS is the future with real world Flexibility.