1 - 3 - Data Model
1 - 3 - Data Model
IN DBMS
Data Models
Data Model gives us an idea that how the final system
will look like after its complete implementation.
SI-DBMS-UU 2
Contd…
Data Model is the modeling of the data description,
data semantics, and consistency constraints of the
data.
Hierarchical Model
Network Model
Entity-Relationship Model
Relational Model
Object-Oriented Data Model
Object-Relational Data Model
Flat Data Model
Semi-Structured
SI-DBMS-UU
Data Model 4
Hierarchical Model
SI-DBMS-UU 5
Example
We can represent the relationship between the shoes
present on a shopping website in the following way:
SI-DBMS-UU 6
Features of a Hierarchical Model
One-to-many relationship:
The data here is organized in a tree-like structure
where the one-to-many relationship is between the
data types.
There can be only one path from parent to any
node.
Example: In the above example, if we want to go to
the node sneakers we only have one path to reach
there i.e through men's shoes node.
SI-DBMS-UU 7
Contd…
Parent-Child Relationship: Each child node has a
parent node but a parent node can have more than
one child node. Multiple parents are not allowed.
SI-DBMS-UU 8
Contd…
Example: In the above example the ' shoes ' node points
to the two other nodes ' women shoes ' node and ' men's
shoes ' node.
SI-DBMS-UU 9
Advantages of Hierarchical Model
SI-DBMS-UU 10
Disadvantages of Hierarchical Model
Complex relationships are not supported.
SI-DBMS-UU 14
Contd…
SI-DBMS-UU 15
Advantages of Network Model
SI-DBMS-UU 16
Disadvantages of Network Model
SI-DBMS-UU 17
Entity-Relationship Model
Entity-Relationship Model or simply ER Model is a high-
level data model diagram.
In this model, we represent the real-world problem in the
pictorial form to make it easy for the stakeholders to
understand.
It is also very easy for the developers to understand the
system by just looking at the ER diagram.
An ER model is the logical representation of data as
objects and relationships among them.
These objects are known as entities, and relationship is
an association among these entities.
This model was designed by Peter Chen and published in
1976 papers.
SI-DBMS-UU 18
Contd…
It was widely used in database designing.
A set of attributes describe the entities.
For example, student_name, student_id describes the
'student' entity.
A set of the same type of entities is known as an 'Entity
set', and the set of the same type of relationships is
known as 'relationship set'.
We use the ER diagram as a visual tool to represent an
ER Model.
ER diagram has the following three components:
SI-DBMS-UU 19
Contd…
Entities: Entity is a real-world thing. It can be a person,
place, or even a concept. Example: Teachers, Students,
Course, Building, Department, etc are some of the
entities of a School Management System.
Attributes: An entity contains a real-world property
called attribute. This is the characteristics of that
attribute. Example: The entity teacher has the property
like teacher id, salary, age, etc.
Relationship: Relationship tells how two attributes are
related. Example: Teacher works for a department.
SI-DBMS-UU 20
Contd…
SI-DBMS-UU 22
Advantages of ER Model
SI-DBMS-UU 24
Disadvantages of ER Model
No industry standard for notation: There is no
industry standard for developing an ER model. So one
developer might use notations which are not
understood by other developers.
SI-DBMS-UU 28
Features of Relational Model
Tuples :
SI-DBMS-UU 29
Contd…
Attribute or field:
SI-DBMS-UU 30
Advantages of Relational Model
SI-DBMS-UU 37
Semi-structured Data Model:
This type of data model is different from the other models.
Semi-structured model is an evolved form of the relational
model.
The semi-structured data model allows the data
specifications at places where the individual data items of
the same type may have different attributes sets.
The Extensible Markup Language, also known as XML, is
widely used for representing the semi-structured data.
Although XML was initially designed for including the markup
information to the text document, it gains importance
because of its application in the exchange of data.
SI-DBMS-UU 38
Example
SI-DBMS-UU 39
That’s All
SI-DBMS-UU 40
Queries???
SI-DBMS-UU 41