Data models
A collection of conceptual tools for describing data, data relationships,
data semantics, and consistency constraints.
It provides a way to describe the design of a database at
the physical, logical, and view levels.
• Relational model
• Entity-Relationship model
• Object-oriented model
• Semi-structured model
• Network model
• Hierarchical model
• Entity-Relationship model
It is a high-level data model which is used to define the data and
the relationships between them. It is basically a conceptual design
of any database which is easy to design the view of data.
• Components of ER Model:
[Link]: An entity is referred to as a real-world object. It can be a
name, place, object, class, etc. These are represented by a
rectangle in an ER Diagram.
[Link]: An attribute can be defined as the description of the
entity. These are represented by Ellipse in an ER Diagram. It can
be Age, Roll Number, or Marks for a Student.
[Link]: Relationships are used to define relations among
different entities. Diamonds are used to show Relationships.
Object-oriented model
Object-
An object is an abstraction of a real world entity or we can say it is an instance
of class. It encapsulates data and code into a single unit which provide data
abstraction by hiding the implementation details from the user.
Attribute –
An attribute describes the properties of object. For example: Object is
STUDENT and its attribute are Roll no, Branch
Methods –
Method represents the behavior of an object. Basically, it represents the real-
world action. For example: Finding a STUDENT marks in above figure as
Setmarks().
Class –
A class is a collection of similar objects with shared structure i.e. attributes and
behavior i.e. methods. An object is an instance of class. For example: Person,
Student, Doctor, Engineer in above figure.
• Semi-Structured model
The semistructured data model permits the specification of data
where individual data items of the same type may have different
sets of attributes. This is in contrast to the data models mentioned
earlier, where every data item of a particular type must have the
same set of attributes. The Extensible Markup Language (XML) is
widely used to represent semi-structured data.
• Hierarchical data model
In this, the data is organized into a tree-like structure where each
record consists of one parent record and many children.
The main disadvantage of the hierarchical model is that it can have
one-to-one and one-to-many relationships between the nodes.
• Network data model
This model can consist of multiple parent segments and these
segments are grouped as levels but there exists a logical association
between the segments belonging to any level.
Mostly, there exists a many-to-many logical association between
any of the two segments. We called graphs the logical associations
between the segments. Therefore, this model replaces the
hierarchical tree with a graph-like structure.
It allows 1:1, 1:M, M:M relationship.