Data_Model
Data_Model
Data Model gives us an idea that how the final system will look like after its
complete implementation. It defines the data elements and the relationships
between the data elements. Data Models are used to show how data is
stored, connected, accessed and updated in the database management
system.
Hierarchical Model
Hierarchical Model was the first DBMS model. This model organizes the data
in the hierarchical tree structure. The hierarchy starts from the root which
has root data and then it expands in the form of a tree adding child node to
the parent node. This model easily represents some of the real-world
relationships like food recipes, sitemap of a website etc.
Network Model
This model is an extension of the hierarchical model. It was the most
popular model before the relational model. This model is the same as the
hierarchical model, the only difference is that a record can have more than
one parent. It replaces the hierarchical tree with a graph. Example: In the
example below we can see that node student has two parents i.e. CSE
Department and Library. This was earlier not possible in the hierarchical
model.
Entity Relationship Model(E-R Model):
The Entity Relationship(E-R) data model is based on concept of real world
that consists of a collection of basic objects called 'entities' and relationship
among the object.
Entity-
An Entity in an E-R Data Model is a real world object having properties
called Attributes.
Attributes-
Every attribute is defined by set of values called domain.
Relationship:
A logical Association among several entities.
Example: In the above example we add 'Teacher' entity with attribute
T_Name, T_class. So student and teacher can be relationship with relation
class.
One entity can have 2,3 more relationship with other entity.
Relational model
In relational model, the data and relationships are represented by collection of
inter-related tables. Each table is a group of column and rows, where column
represents attribute of an entity and rows represents records.
Sample relationship Model: Student table with 3 columns and four records.
Table: Student
Stu_Id Stu_Name Stu_Age
111 Ashish 23
123 Saurav 22
169 Lester 24
234 Lou 26
Table: Course
Stu_Id Course_Id Course_Name
In the above example, we have two objects Employee and Department. All
the data and relationships of each object are contained as a single unit. The
attributes like Name, Job_title of the employee and the methods which will
be performed by that object are stored as a single object. The two objects
are connected through a common attribute i.e the Department_id and the
communication between these two will be done with the help of this
common id.