0% found this document useful (0 votes)
3 views41 pages

1 - 3 - Data Model

The document discusses various data models used in Database Management Systems (DBMS), including Hierarchical, Network, Entity-Relationship, Relational, Object-Oriented, Object-Relational, Flat, and Semi-Structured models. It highlights the structure, advantages, and disadvantages of each model, emphasizing the Relational model as the most widely used. Additionally, it explains the importance of data models in defining data elements and their relationships, as well as their role in database design and implementation.

Uploaded by

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

1 - 3 - Data Model

The document discusses various data models used in Database Management Systems (DBMS), including Hierarchical, Network, Entity-Relationship, Relational, Object-Oriented, Object-Relational, Flat, and Semi-Structured models. It highlights the structure, advantages, and disadvantages of each model, emphasizing the Relational model as the most widely used. Additionally, it explains the importance of data models in defining data elements and their relationships, as well as their role in database design and implementation.

Uploaded by

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

Data Models

IN DBMS
Data Models
 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.

SI-DBMS-UU 2
Contd…
 Data Model is the modeling of the data description,
data semantics, and consistency constraints of the
data.

 It provides the conceptual tools for describing the


design of a database at each level of data
abstraction.

 There are many data models being used nowadays


but the Relational model is the most widely used
model.
SI-DBMS-UU 3
Contd…
Some of the Data Models in DBMS are:

 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

 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.

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.

 Deletion Problem: If a parent node is deleted then


the child node is automatically deleted.

SI-DBMS-UU 8
Contd…

 Pointers: Pointers are used to link the parent node with


the child node and are used to navigate between the
stored data.

 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

 It is very simple and fast to traverse through a tree-


like structure.

 Any change in the parent node is automatically


reflected in the child node so, the integrity of data is
maintained.

SI-DBMS-UU 10
Disadvantages of Hierarchical Model
 Complex relationships are not supported.

 As it does not support more than one parent of the


child node so if we have some complex relationship
where a child node needs to have two parent node
then that can't be represented using this model.

 If a parent node is deleted then the child node is


automatically deleted.
SI-DBMS-UU 11
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.
SI-DBMS-UU 12
Contd…

 Example: In the example we can see that node student


has two parents i.e. CSE Department and Library. This
was earlier not possible in the hierarchical model.
SI-DBMS-UU 13
Features of a Network Model

 Ability to Merge more Relationships: In this model, as


there are more relationships so data is more related.
This model has the ability to manage one-to-one
relationships as well as many-to-many relationships.

 Many paths: As there are more relationships so there


can be more than one path to the same record. This
makes data access fast and simple.

SI-DBMS-UU 14
Contd…

 Circular Linked List: The operations on the network


model are done with the help of the circular linked list.
The current position is maintained with the help of a
program and this position navigates through the records
according to the relationship.

SI-DBMS-UU 15
Advantages of Network Model

 The data can be accessed faster as compared to the


hierarchical model. This is because the data is more
related in the network model and there can be more
than one path to reach a particular node. So the data
can be accessed in many ways.
 As there is a parent-child relationship so data
integrity is present. Any change in parent record is
reflected in the child record.

SI-DBMS-UU 16
Disadvantages of Network Model

 As more and more relationships need to be handled


the system might get complex. So, a user must be
having detailed knowledge of the model to work
with the model.

 Any change like updation, deletion, insertion is very


complex.

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…

 Here, the entities are Teacher and Department.


 The attributes of Teacher entity are Teacher_Name, Teacher_id, Age, Salary,
Mobile_Number.
 The attributes of entity Department entity are Dept_id, Dept_name.
 The two entities are connected using the relationship. Here, each teacher
SI-DBMS-UU 21

works for a department.


Features of ER Model

 Graphical Representation for Better Understanding: It is


very easy and simple to understand so it can be used by the
developers to communicate with the stakeholders.
 ER Diagram: ER diagram is used as a visual tool for
representing the model.
 Database Design: This model helps the database designers
to build the database and is widely used in database design.

SI-DBMS-UU 22
Advantages of ER Model

 Simple: Conceptually ER Model is very easy to build. If


we know the relationship between the attributes and
the entities we can easily build the ER Diagram for the
model.

 Effective Communication Tool : This model is used


widely by the database designers for communicating
their ideas.
SI-DBMS-UU 23
Contd…

 Easy Conversion to any Model : This model maps well


to the relational model and can be easily converted
relational model by converting the ER model to the
table. This model can also be converted to any other
model like network model, hierarchical model etc.

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.

 Hidden information: Some information might be lost


or hidden in the ER model. As it is a high-level view so
there are chances that some details of information
might be hidden.
SI-DBMS-UU 25
Relational Data Model:
 This type of model designs the data in the form of
rows and columns within a table.
 This model was initially described by Edgar F. Codd, in
1969.
 A relational model uses tables for representing data
and in-between relationships.
 Tables are also called relations.
 The relational data model is the widely used model
which is primarily used by commercial data processing
applications.
SI-DBMS-UU 26
Contd…
 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: In next example, we have an Employee


table.
SI-DBMS-UU 27
Contd…
 Example: The Employee table is shown -

SI-DBMS-UU 28
Features of Relational Model

Tuples :

 Each row in the table is called tuple.


 A row contains all the information about any instance of
the object.
 In the above example, each row has all the information
about any specific individual like the first row has
information about John.

SI-DBMS-UU 29
Contd…

Attribute or field:

 Attributes are the property which defines the table or


relation.
 The values of the attribute should be from the same
domain.
 In the above example, we have different attributes of
the employee like Salary, Mobile_no, etc.

SI-DBMS-UU 30
Advantages of Relational Model

 Simple: This model is more simple as compared to the


network and hierarchical model.
 Scalable: This model can be easily scaled as we can
add as many rows and columns we want.
 Structural Independence: We can make changes in
database structure without changing the way to access
the data. When we can make changes to the database
structure without affecting the capability to DBMS to
access the data we can say that structural
independence has been achieved.
SI-DBMS-UU 31
Disadvantages of Relational Model

 Hardware Overheads: For hiding the complexities


and making things easier for the user this model
requires more powerful hardware computers and data
storage devices.

 Bad Design: As the relational model is very easy to


design and use. So the users don't need to know how
the data is stored in order to access it. This ease of
design can lead to the development of a poor
database which would slow down if the database
grows.
SI-DBMS-UU 32
Object-Oriented Data Model

 The real-world problems are more closely represented


through the object-oriented data model.

 An extension of the ER model with notions of


functions, encapsulation, and object identity, as well.

 This model supports a rich type system that includes


structured and collection types.

 In this model, both the data and relationship are


present in a single structure known as an object.
SI-DBMS-UU 33
Contd…
 We can store audio, video, images, etc in the database
which was not possible in the relational
model(although you can store audio and video in
relational database, it is advised not to store in the
relational database).

 In this model, two are more objects are connected


through links. We use this link to relate one object to
other objects. This can be understood by the example
given below.
SI-DBMS-UU 34
Contd…

 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 this35 common id.
SI-DBMS-UU
Object-Relational Model

 It is a combination of both the relational model and


the object-oriented model.
 This model was built to fill the gap between object-
oriented model and the relational model.
 We can have many advanced features like we can
make complex data types according to our
requirements using the existing data types.
 The problem with this model is that this can get
complex and difficult to handle. So, proper
understanding of this model is required.
SI-DBMS-UU 36
Flat Data Model
 It is a simple model in which the database is
represented as a table consisting of rows and columns.

 To access any data, the computer has to read the


entire table.

 This makes the modes slow and inefficient.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy