0% found this document useful (0 votes)
2 views

DBMS_slide_2_Data_Models_PPT

Uploaded by

rathika.p
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

DBMS_slide_2_Data_Models_PPT

Uploaded by

rathika.p
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

DATABASE

MANAGEMEN
T SYSTEMS
Data Models
What is a Data Model?

Data model is a collection of conceptual tools for describing data,


data relationships, data semantics and consistency constraints.
That means a data model provides a way to describe the design of
a database.

Data models are widely used in database management systems to


demonstrate how data is related, stored, retrieved, and modified. We
depict information using a set of symbols and terminology so that
members of an organisation may understand and comprehend it before
communicating.

Data
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Data model basic building blocks

Entity
An entity is anything about which data are to be collected and

Database Management Systems


stored. An entity represents a particular type of object in the real
world.
Entity Set
Set of entities of the same type that share the same properties
are called
as entity sets.
Attribute
An attribute is a characteristic of an entity.

Constraints

Data
A constraint is a restriction placed on the data. Constraints are
important
because they help to ensure data integrity.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Relationships

A relationship describes an association among entities.


Different types of relationship are:

Database Management Systems


One to One (1:1) relationship:

One to Many (1:M) relationship:

Data
Many to Many (M:N) relationship:

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Hierarchical model

The hierarchical model classifies the data into a tree-like


structure with a single parent or root for each record. Sibling
records are arranged in a certain sequence. This is the physical

Database Management Systems


order in which the database is stored. This model is useful for
explaining a wide range of real-world interactions.

Data
It depicts a set of 1:M relationships between a parent and its children
segments
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Cont…

Advantages of Hierarchical Model

Database Management Systems


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

Data
• If a parent node is deleted then the child node is
automatically deleted.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Network Model

This paradigm is an expansion of the hierarchical model. It was


the most prevalent model prior to the relational model. The main
difference between this model and the hierarchical approach is

Database Management Systems


that a record can have several parents. It replaces the
hierarchical tree with a graph. In the sample below, we can see
that node student has two parents, CSE Department and Library.
This was previously not allowed in the hierarchical model.

Data
Ms.Rathika.P /AP-CSE

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be


University
Cont…

Advantages of Network Model


• When compared to the hierarchical approach, data may be

Database Management Systems


obtained more quickly. This is because the data in the network
model is more linked and there may be more than one path to a
certain node. As a result, the information may be accessed in a
variety of ways.

• Data integrity is present since there is a parent-child connection. Any


changes

Disadvantages of Network Model


• As additional relationships are added, the system may get
increasingly complicated. To operate with the model, a user needs
have full understanding of it.

• Any modification, such as an update, deletion, or insertion, is quite

Data
difficult.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Entity-Relationship Model

The Entity-Relationship Model, sometimes known as the ER Model, is a


high-level data model diagram. We express the real-world problem in
visual form in this model to make it easier for stakeholders to grasp.

Database Management Systems


The ER diagram also makes it extremely simple for developers to
comprehend the system. The ER diagram is a visual tool used to
depict an ER Model. The ER diagram is made up of three parts:

Data
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
ER (Entity Relationship) Diagram in DBMS
In ER modeling, the database structure is portrayed as a diagram called an entity-relationship
diagram.

For example, Suppose we design a school database. In this database, the student will be an
entity with attributes like address, name, id, age, etc. The address can be another entity with
attributes like city, street name, pin code, etc and there will be a relationship between them.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Component of ER Diagram

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
1. Entity:
An entity may be any object, class, person or place. In the ER diagram, an entity can be represented as rectangles.

Consider an organization as an example- manager, product, employee, department etc. can be taken as an entity.

a. Weak Entity

An entity that depends on another entity called a weak entity. The weak entity doesn't contain any key attribute of its own. The weak entity
is represented by a double rectangle.

2. Attribute

3.
The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.

For example, id, age, contact number, name, etc. can be attributes of a student.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
a. Key Attribute

The key attribute is used to represent the main characteristics of an entity. It represents a primary key. The key attribute is represented by
an ellipse with the text underlined.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
b. Composite Attribute
An attribute that composed of many other attributes is known as a composite attribute. The composite attribute is represented by an
ellipse, and those ellipses are connected with an ellipse.

c. Multivalued Attribute

An attribute can have more than one value. These attributes are known as a multivalued attribute. The double oval is used to represent
multivalued attribute.

For example, a student can have more than one phone number.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
d. Derived Attribute

An attribute that can be derived from other attribute is known as a derived attribute. It can be represented by a dashed ellipse.

For example, A person's age changes over time and can be derived from another attribute like Date of birth.

3. Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus is used to represent the relationship.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Types of relationship are as follows:

a. One-to-One Relationship

When only one instance of an entity is associated with the relationship, then it is known as one to one relationship.

For example, A female can marry to one male, and a male can marry to one female.

b. One-to-many relationship

When only one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship then
this is known as a one-to-many relationship.

For example, Scientist can invent many inventions, but the invention is done by the only specific scientist.

c. Many-to-one relationship

When more than one instance of the entity on the left, and only one instance of an entity on the right associates with the relationship then
it is known as a many-to-one relationship.
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
For example, Student enrolls for only one course, but a course can have many students.

d. Many-to-many relationship

When more than one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship
then it is known as a many-to-many relationship.

For example, Employee can assign by many projects and project can have many employees.

Online Tool for ER Diagram

https://app.smartdraw.com/editor.aspx?templateId=359473cb-5a63-4fa6-aa39-
https://app.smartdraw.com/editor.aspx?templateId=359473cb-5a63-4fa6-aa39-2ce9909f4c46&flags=128#depoId=63824472&credID=-
74156275 2ce9909f4c46&flags=128#depoId=63824472&credID=-74156275

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Advantages of Entity-Relationship 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.

Database Management Systems


• Effective Communication Tool : This model is used widely by
the database designers for communicating their ideas.

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

Disadvantages of Entity-Relationship 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.

Data
• 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.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Relational Model

The most common model is the Relational Model. The data in this
model is kept in the form of a two-dimensional table. All data is
saved in the form of rows and columns. Tables are the foundation

Database Management Systems


of a relational paradigm. In the relational paradigm, the tables are
also referred to as relations. Example: We have an Employee
table in this example.

Data
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Cont…

Advantages of Relational Data Model


• Simple: This model is more simple as compared to the
network and hierarchical model.

Database Management Systems


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

Disadvantages of Relational Data 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.

Data
• 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.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Object-Oriented(OO) Model

A database, according to this paradigm, is a collection of objects,


or reusable software parts, with related characteristics and
operations.

Database Management Systems


• Object-oriented databases are classified into numerous types: A multimedia
database contains media, such as photos, that would be impossible to store in
a relational database.

• Any object in a hypertext database can link to any other object. It is effective
for organizing a large amount of heterogeneous data, but it is not perfect for
numerical analysis.

• Because it integrates but is not limited to tables, the object-oriented database


model is the most well-known post-relational database paradigm. These types
of models are often known as hybrid database models.

Data
OODs are most often used with object-oriented programming languages like Java, Kotlin, C#, Node JS

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
(React), and Swift.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Cont…

Advantages of Object Oriented Data Model


• Complex data sets can be saved and retrieved quickly and easily.

Database Management Systems


• Object IDs are assigned automatically.
• Works well with object-oriented programming languages.
• Semantic content is added
• Support for complex objects
• Visual representation includes semantic content

Disadvantages of Object Oriented Data Model


• Object databases are not widely adopted.
• In some situations, the high complexity can cause performance

Data
problems.
• High system overheads slow transactions.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Object-Relational (OR) Model

As the name implies, it is a hybrid of the relational and object-oriented


models. This paradigm was created to bridge the gap between the object-
oriented and relational models. We can have many sophisticated features,

Database Management Systems


such as the ability to create complicated data types based on our needs
utilising current data types. The issue with this paradigm is that it may
become complicated and difficult to manage.

As a result, a thorough comprehension of this paradigm is essential.

Data
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
OO vs OR Data Model

• Object-Oriented database
A database that represents • Object-Relational database
A database that depends on
information in the form of objects Relational data model and Object

Database Management Systems


as inspired by Object oriented oriented data model.
programming.
• Hybrid of relational and object
• Depends on OOP. oriented model.

• In object oriented database, • In object t relational database,


connections between two relations
relationships are represented are represented by foreign key
by references via the object attributes in one relation that
identifier (OID). vs reference the primary key of another
relation.
• Handles larger and complex data
than RDBMS. • Handles comparatively simpler data.

• Less efficient. • Improvement and comparatively


more efficient.
• The data management language

Data
is typically incorporated into a • There are data manipulation
programming language such as languages such as SQL, QUEL and
#C++. QBE which are based on
relational calculus.

Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University
Semi-structured Model

The semi-structured model emerged from the relational model.

In this paradigm, we can't tell the difference between data and

Database Management Systems


schema. Web- based data sources, for example, when we cannot
distinguish between the website's structure and data. Some entities
in this model may be missing characteristics, while others may have
an additional attribute. This approach allows for greater data storage
flexibility. It also provides qualities with flexibility.

A few examples of semi-structured data sources are emails, XML


and other markup languages, binary executables, TCP/IP
packets, zipped files, data integrated from different sources, and
web pages.

Data
Dr.
Ms.Rathika.P
Jay Sarraf,/AP-CSE
School of Computer Engineering, KIIT Deemed to be
University

You might also like