0% found this document useful (0 votes)
11 views25 pages

Data Model in Dbms

Uploaded by

www.aarijkhan0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views25 pages

Data Model in Dbms

Uploaded by

www.aarijkhan0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Data Model

BY :
Megha Yadav
Data Model

• Data Model is a logical structure of Database.


• It describes the design of database to reflect entities, attributes, relationship
among data, constraint etc.
1

While the Relational Model is the most widely used database model, there are
other models too:

• Hierarchical Model
• Network Model
• Entity-relationship Model
• Relational Model
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.
ER diagram has the following three components:

• Entities: Entity is a real-world thing. It can be a


person, place, or even a
concept. Example: Teachers, Students, Course,
Building, Department, etc
• Attributes: . 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.
1

• This is an ER model of a Hospital. The entities are represented in


rectangular boxes and are Patient, Tests and Doctor.
• Each of these entities have their respective attributes which are −
• Patients - ID(primary key), name, age,visit_date
• Tests- Name(primary key), date, result
• Doctor- ID(primary key), name, specialization
Relational Model

• Relational Model is the most widely used model.


• In this model, the data is maintained in the form of a two-dimensional table.
• All the information is stored in the form of row and columns.
• The basic structure of a relational model is tables.
• So, the tables are also called relations in the relational model.
Example:

• Tuples: Each row in the table is called tuple. A


row contains all the information about any
instance of the object.
• Attribute or field: Attributes are the property
which defines the table or relation. In the
above example, we have different attributes of
the employee like Salary, Mobile_no, etc.
1

• Tuple- A row of the table is called a tuple. It stores the data details
according to the table schema.
• Column- A column of the database represents the same form of data.
Example - In the above database, Name represents names of all the
employees.
• Relational Schema - A relational schema defines the table name and
its attributes.
Network Database Model

• The network database model was created to solve the shortcomings of the
hierarchical database model.
• In this type of model, a child can be linked to multiple parents, a feature that
was not supported by the hierarchical data model.
• The parent nodes are known as owners and the child nodes are called members.
• the hierarchical tree is replaced by a graph, which allows for more basic
connections with the nodes.
1

• The network model was created to represent complex data relationships more effectively than the
hierarchical model, to improve database performance, and to impose a database standard.

• In the network model, the user perceives the network database as a collection of records in 1:M
relationships. However, unlike the hierarchical model, the network model allows a record to have more
than one parent.

• While the network database model is generally not used today, the definitions of standard database
concepts that emerged with the network model are still used by modern data models.
Advantages of Network Model

• The network model can support many to many relationships and handle
many to many relationships where the hierarchical data model didn’t.
Disadvantages of Network Model

• There are some disadvantages in the network model even though it is an improvement over the
hierarchical model.
• The network model is much more complicated than the Hierarchical model. As such, it is difficult
to to handle and maintain.
• Although the Network model is more flexible than the Hierarchical model, it still has flexibility
problems. Not all relations can handled by assigning them in the form of owners and members.
• The structure of the Network Model is quite complicated and so the programmer has to
understand it well in order to implement or modify it.
Hierarchical Model

• This database model organizes data into a tree-like-structure, with a single


root, to which all the other data is linked. The hierarchy starts from
the Root data, and expands like a tree, adding child nodes to the parent
nodes.
• In this model, a child node will only have a single parent node.
• In hierarchical model, data is organized into tree-like structure with one one-
to-many relationship between two different types of data, for example, one
department can have many courses, many professors and of-course many
students.
Hierarchical structure

• A hierarchical structure refers to a company's chain of command, typically


from senior management and executives to general employees. In other
words, this structure applies to organizations with a sole leader and a flow
of subordinates underneath them.
Advantages of a hierarchical structure

• The model allows easy addition and deletion of new information.


• Data at the top of the Hierarchy is very fast to access.
Database security
• Data independence
• Database integrity
• Efficiency dealing with a large database
Disadvantages of a Hierarchical Organizational
Structure

• Complex implementation
• Difficult to manage

You might also like