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

Dbms_unit 1_lecture Notes (1)

The document provides an overview of Database Management Systems (DBMS), detailing their functions, applications, advantages, and disadvantages. It explains the architecture of DBMS, including 1-Tier, 2-Tier, and 3-Tier architectures, along with the mapping concepts and types of database users. Additionally, it highlights the importance of DBMS in various sectors such as banking, healthcare, and e-commerce, while addressing challenges like cost and complexity.

Uploaded by

utsavmec
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Dbms_unit 1_lecture Notes (1)

The document provides an overview of Database Management Systems (DBMS), detailing their functions, applications, advantages, and disadvantages. It explains the architecture of DBMS, including 1-Tier, 2-Tier, and 3-Tier architectures, along with the mapping concepts and types of database users. Additionally, it highlights the importance of DBMS in various sectors such as banking, healthcare, and e-commerce, while addressing challenges like cost and complexity.

Uploaded by

utsavmec
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Lecture Notes

Database Management System

1. Database
⮚ A database is a collection of interrelated data that helps in the efficient retrieval,
insertion & deletion of data from the database & organized the data in form of tables,
reports, schemas, etc.

2. DBMS
⮚ Database Management System
⮚ It is a software system that is designed to manage & organize data in a structured
manner.
⮚ Allows to create, modify, update, store & retrieval of data.

3. Applications of DBMS
⮚ Railway Reservation System
o In the rail route reservation framework, the information base is needed to
store the record or information of ticket appointments, status of train’s
appearance, and flight. Additionally, if trains get late, individuals become
acquainted with it through the information base update.
⮚ Library Management System
o There are many books in the library so; it is difficult to store the record of the
relative multitude of books in a register or duplicate. Along these lines, the
data set administration framework (DBMS) is utilized to keep up all the data
identified with the name of the book, issue date, accessibility of the book,
and its writer.
⮚ Banking
o Database the executive’s framework is utilized to store the exchange data of
the client in the information base.
⮚ Education Sector
o Presently, assessments are led online by numerous schools and colleges. They
deal with all assessment information through the data set administration
framework (DBMS). In spite of that understudy’s enlistments subtleties,
grades, courses, expense, participation, results, and so forth all the data is put
away in the information base.
⮚ Credit card exchanges
o The database Management framework is utilized for buying on charge cards
and age of month to month proclamations.
⮚ Social Media Sites
o We all utilization of online media sites to associate with companions and to
impart our perspectives to the world. Every day, many people group pursue

PREPARED BY – DR. MAITRI PATEL 1


these online media accounts like Pinterest, Facebook, Twitter, and Google in
addition to. By the utilization of the data set administration framework, all
the data of clients are put away in the information base and, we become ready
to interface with others.
⮚ Broadcast communications
o Without DBMS any media transmission organization can’t think. The
Database the executive’s framework is fundamental for these organizations
to store the call subtleties and month to month post-paid bills in the
information base.
⮚ Accounting and Finance
o The information base administration framework is utilized for putting away
data about deals, holding and acquisition of monetary instruments, for
example, stocks and bonds in a data set.
⮚ E-Commerce Websites
o These days, web-based shopping has become a major pattern. Nobody needs
to visit the shop and burn through their time. Everybody needs to shop
through web-based shopping sites, (for example, Amazon, Flipkart,
Snapdeal) from home. So, all the items are sold and added uniquely with the
assistance of the information base administration framework (DBMS).
Receipt charges, instalments, buy data these are finished with the assistance
of DBMS.
⮚ Human Resource Management
o Big firms or organizations have numerous specialists or representatives
working under them. They store data about worker’s compensation,
assessment, and work with the assistance of an information base
administration framework (DBMS).
⮚ Manufacturing
o Manufacturing organizations make various kinds of items and deal them
consistently. To keep the data about their items like bills, acquisition of the
item, amount, inventory network the executives, information base
administration framework (DBMS) is utilized.
⮚ Airline Reservation System
o This framework is equivalent to the railroad reservation framework. This
framework additionally utilizes an information base administration
framework to store the records of flight takeoff, appearance, and defer status.
⮚ Healthcare System
o DBMS is used in healthcare to manage patient data, medical records, and
billing information.
⮚ Security
o DBMS provides security features to ensure that only authorized users have
access to the data.
⮚ Telecommunication

PREPARED BY – DR. MAITRI PATEL 2


o Database Management Systems (DBMS) are essential to the
telecommunications industry because they manage enormous volumes of
data on billing, customer information, and network optimization.

4. Advantages of DBMS
⮚ Data Security
o The more accessible and usable the database, the more it is prone to security
issues. As the number of users increases, the data transferring or data sharing
rate also increases thus increasing the risk of data security. It is widely used
in the corporate world where companies invest large amounts of money, time,
and effort to ensure data is secure and used properly. A Database Management
System (DBMS) provides a better platform for data privacy and security
policies thus, helping companies to improve Data Security.
⮚ Data integration
o Due to the Database Management System we have access to well-managed
and synchronized forms of data thus it makes data handling very easy and
gives an integrated view of how a particular organization is working and also
helps to keep track of how one segment of the company affects another
segment.
⮚ Data abstraction
o The major purpose of a database system is to provide users with an abstract
view of the data. Since many complex algorithms are used by the developers
to increase the efficiency of databases that are being hidden by the users
through various data abstraction levels to allow users to easily interact with
the system.
⮚ Reduction in data Redundancy
o When working with a structured database, DBMS provides the feature to
prevent the input of duplicate items in the database. for e.g. – If there are two
same students in different rows, then one of the duplicate data will be deleted.
⮚ Data sharing
o A DBMS provides a platform for sharing data across multiple applications
and users, which can increase productivity and collaboration.
⮚ Data consistency and accuracy
o DBMS ensures that data is consistent and accurate by enforcing data integrity
constraints and preventing data duplication. This helps to eliminate data
discrepancies and errors that can occur when data is stored and managed
manually.
⮚ Data organization
o A DBMS provides a systematic approach to organizing data in a structured
way, which makes it easier to retrieve and manage data efficiently.
⮚ Efficient data access and retrieval
o DBMS allows for efficient data access and retrieval by providing indexing
and query optimization techniques that speed up data retrieval. This reduces

PREPARED BY – DR. MAITRI PATEL 3


the time required to process large volumes of data and increases the overall
performance of the system.
⮚ Concurrency and maintained Atomicity
o That means, if some operation is performed on one particular table of the
database, then the change must be reflected for the entire database. The
DBMS allows concurrent access to multiple users by using the
synchronization technique.
⮚ Scalability and flexibility
o DBMS is highly scalable and can easily accommodate changes in data
volumes and user requirements. DBMS can easily handle large volumes of
data, and can scale up or down depending on the needs of the organization. It
provides flexibility in data storage, retrieval, and manipulation, allowing
users to easily modify the structure and content of the database as needed.

5. Disadvantages of DBMS
⮚ Increased cost
o There are various types of costs. These are explained below.
o Cost of hardware and software
▪ To run the DBMS, there is must need for high-speed processors and
large memory size. The cost of a high-speed processor and large
memory storage is very expensive in hardware and software.
▪ So we need to upgrade our hardware and software for the smooth
running of DBMS, which will be very expensive. Also, the
maintenance cost for both hardware and software is very expensive.
All the operations, regulatory compliance, and training (like
programming, application development, and database administration)
are very expensive.
o Cost of staff training
▪ There is a need for application programmers, database administrators,
and data entry operators in the large amount. We also need the
database system designer and the application programmer. So there is
a need for huge money to establish a software house to develop
software.
o Cost of data conversion
▪ We need to change our Database to DBMS. There is also a need for a
lot of money to shift the Database to the DBMS. This is because we
need the database designer to shift the Database to DBMS. We have
to pay lots of money for the software houses. Also, we have a high
investment in the software, hardware, and staff training for the DBMS.
⮚ Complexity
o In today's world, all companies have a DBMS to store their important data
securely. For this, the company has to fulfill all the requirements and the

PREPARED BY – DR. MAITRI PATEL 4


problems. But the functionality of DBMS requires extremely required
software.
o To handle this problem, all companies need employees with the proper
knowledge of designers, developers, DBA, and end users. This is because if
any employee does not have the proper knowledge, there might be a chance
of big data loss.
⮚ Currency Maintenance
o This is necessary to keep your system current because efficiency, one of the
biggest factors that need to be overlooked, must be maximized. That is, we
need to maximize the efficiency of the database system to keep our system
current.
o For this, frequent updation must be performed on all the components as new
threats come daily. DBMS should be updated according to the current
scenario. Also, security measures must be implemented. Due to advancement
in database technology, training cost tends to be significant.
⮚ Performance
o The traditional file system is written for small organizations and for some
specific applications, due to which performance is generally very good. But
for small-scale firms, DBMS does not perform well as its speed is very slow.
As a result, some applications will not run as fast as they could. Hence it is
not good to use DBMS for small firms. Because performance is a factor that
everyone overlooks, if performance is good, then everyone (developers,
designers, end-users) will use it easily, and it will be user-friendly too. The
system's speed depends on the performance, so performance needs to be
good.
⮚ Frequency Upgrade/Replacement Cycles
o Nowadays, we need to stay up-to-date about the latest technologies and
developments in the market. The DBMS vendors frequently upgrade the
products to add new functionality to the systems. New upgrade versions of
the software often come bundled.

6. Architecture of DBMS
⮚ There are several types of DBMS Architecture, as below:
o 1-Tier Architecture
o 2-Tier Architecture
o 3-Tier Architecture
⮚ 1-Tier Architecture
o In 1-Tier Architecture the database is directly available to the user, the user
can directly work on the DBMS, the client, server, and Database are all
present on the same machine.
o This architecture is simple and works well for personal, standalone
applications where no external server or network connection is needed.

PREPARED BY – DR. MAITRI PATEL 5


o Advantages
▪ Simple Architecture
● 1-Tier Architecture is the most simple architecture to set up, as
only a single machine is required to maintain it.
▪ Cost-Effective
● No additional hardware is required for implementing 1-Tier
Architecture, which makes it cost-effective.
▪ Easy to Implement
● 1-Tier Architecture can be easily deployed, and hence it is
mostly used in small projects.
⮚ 2-Tier Architecture
o The 2-tier architecture is similar to a basic client-server model . The
application at the client end directly communicates with the database on the
server side. APIs like ODBC and JDBC are used for this interaction.
o The server side is responsible for providing query processing and transaction
management functionalities. On the client side, the user interfaces and
application programs are run.
o The application on the client side establishes a connection with the server
side to communicate with the DBMS.
o The client layer sends a request to the database layer which processes it and
sends back the result. This separation allows the client to focus on the user
interface, while the server handles data storage and retrieval.

o Advantages
▪ Easy to Access
● 2-Tier Architecture makes easy access to the database, which
makes fast retrieval.
▪ Scalable
● We can scale the database easily, by adding clients or upgrading
hardware.
▪ Low Cost

PREPARED BY – DR. MAITRI PATEL 6


● 2-Tier Architecture is cheaper than 3-Tier Architecture
and Multi-Tier Architecture .
▪ Easy Deployment
● 2-Tier Architecture is easier to deploy than 3-Tier Architecture.
▪ Simple
● 2-Tier Architecture is easily understandable as well as simple
because of only two components.
⮚ 3-Tier Architecture
o In 3-tier architecture, there is another layer between the client and the server.
The client interacts with an application server which further communicates
with the database system and then the query processing and transaction
management takes place.
o This intermediate layer acts as a medium for the exchange of partially
processed data between the server and the client.
o This type of architecture is used in the case of large web applications.

o Advantages
▪ Enhanced scalability
● Scalability is enhanced due to the distributed deployment of
application servers. Now, individual connections need not be
made between the client and server.
▪ Data Integrity
● 3-Tier Architecture maintains Data Integrity. Since there is a
middle layer between the client and the server, data corruption
can be avoided/removed.
▪ Security
● 3-Tier Architecture Improves Security. This type of model
prevents direct interaction of the client with the server thereby
reducing access to unauthorized data.
o Disadvantages
▪ More Complex
● 3-Tier Architecture is more complex in comparison to 2-Tier
Architecture. Communication Points are also doubled in 3-Tier
Architecture.
▪ Difficult to Interact
● It becomes difficult for this sort of interaction to take place due
to the presence of middle layers.

PREPARED BY – DR. MAITRI PATEL 7


7. Mapping
⮚ Mapping is the concept of transforming different requests and responses between
levels of database architecture.
⮚ Types:
o Conceptual/internal mapping
o External/conceptual mapping
⮚ Conceptual/internal mapping
o It communicates between conceptual and internal level view.
o It specifies how conceptual records are mapped on physical storage media.
o If physical media storage changes then again conceptual view will mep the
records.
⮚ External/conceptual mapping
o It communicates between external view & conceptual view.
o Number of different conceptual views combine to make an external view in
a specific mapping.

8. Users of database
⮚ Database users are categorized based on their interaction with the database. There
are seven types of database users in DBMS.
⮚ Types:
o Database Administrator (DBA)
o Naive / Parametric End Users
o A System Analyst
o Sophisticated Users
o Database Designers
o Application Programmers
o Casual Users / Temporary Users
o Specialized users
⮚ Database Administrator (DBA)
o A Database Administrator (DBA) is a person/team who defines the schema
and also controls the 3 levels of the database. The DBA will then create a new
account ID and password for the user if he/she needs to access the database.
o DBA is also responsible for providing security to the database and he allows
only authorized users to access/modify the database. DBA is responsible for
problems such as security breaches and poor system response time.
⮚ Naive / Parametric End Users
o Parametric End Users are the unsophisticated who don’t have any DBMS
knowledge but they frequently use the database applications in their daily life
to get the desired results.
o For example, Railway’s ticket booking users are naive users. Clerks in any
bank is a naive user because they don’t have any DBMS knowledge but they
still use the database and perform their given task.
⮚ A System Analyst

PREPARED BY – DR. MAITRI PATEL 8


o A system Analyst is a user who analyzes the requirements of parametric end
users. They check whether all the requirements of end users are satisfied.
⮚ Sophisticated Users
o Sophisticated users can be engineers, scientists, business analyst, who are
familiar with the database. They can develop their own database applications
according to their requirement.
o They don’t write the program code but they interact the database by writing
SQL queries directly through the query processor.
⮚ Database Designers
o DataBase Designers are the users who design the structure of database which
includes tables, indexes, views, triggers, stored procedures and constraints
which are usually enforced before the database is created or populated with
data.
o He/she controls what data must be stored and how the data items to be related.
It is the responsibility of Database Designers to understand the requirements
of different user groups and then create a design which satisfies the need of
all the user groups.
⮚ Application Programmers
o Application Programmers also referred as System Analysts or simply
Software Engineers, are the back-end programmers who write the code for
the application programs. They are computer professionals.
o These programs could be written in Programming languages such as Visual
Basic, Developer, C, FORTRAN, COBOL etc. Application programmers
design, debug, test, and maintain a set of programs called “canned
transactions” for the Naive (parametric) users in order to interact with the
database.
⮚ Casual Users / Temporary Users
o Casual Users are the users who occasionally use/access the database but each
time when they access the database they require the new information, for
example, Middle or higher level manager.
⮚ Specialized users
o Specialized users are sophisticated users who write specialized database
application that does not fit into the traditional data-processing framework.
Among these applications are computer aided-design systems, knowledge-
base and expert systems etc.

9. Data models
⮚ 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 4 data models, as below
o Relational data model
o Semi-structured data model

PREPARED BY – DR. MAITRI PATEL 9


o Entity-Relationship data model
o Object-based data model
⮚ Relational Data Model
o This type of model designs the data in the form of rows and columns within
a table. Thus, a relational model uses tables for representing data and in-
between relationships.
o Tables are also called relations. This model was initially described by Edgar
F. Codd, in 1969. The relational data model is the widely used model which
is primarily used by commercial data processing applications.
⮚ Entity-Relationship Data Model
o 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.
o This model was designed by Peter Chen and published in 1976 papers. It was
widely used in database designing. A set of attributes describe the entities.
o 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'.
⮚ Object-based Data Model
o 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.
o In 1980s, various database systems following the object-oriented approach
were developed. Here, the objects are nothing but the data carrying its
properties.
⮚ Semi structured Data Model
o This type of data model is different from the other three data models
(explained above). 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.
o 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.

10. Hierarchical Data Model


⮚ The Hierarchical Model was the first database management system model. This
concept uses a hierarchical tree structure to organise the data. The hierarchy begins
at the root, which contains root data, and then grows into a tree as child nodes are
added to the parent node.
⮚ This model accurately depicts several real-world relationships such as food recipes,
website sitemaps, etc.
⮚ Example

PREPARED BY – DR. MAITRI PATEL 10


o The following diagram depicts the relationship between the shoes available
on a shopping website:

⮚ Features
o Parent-Child Relationship
▪ A parent node exists for each child node. However, a parent node
might have several child nodes. It is not permitted to have more than
one parent.
o One-to-many Relationship
▪ The data is organised in a tree-like form, with the datatypes having a
one-to-many relationship. There can only be one path from any node
to its parent.
▪ For example, in the preceding example, there is only one way to get
to the node ‘sneakers’, which is through the ‘men’s shoes’ node.
o Deletion Problem
▪ When a parent node is removed, the child node is removed as well.
o Pointers
▪ Pointers are used to connect the parent and child nodes and to traverse
and navigate between the stored data. The ‘shoes’ node in the above
example points to the two additional nodes, ‘women’s shoes’ and
‘men’s shoes.’
⮚ Advantages
o A tree-like structure is incredibly straightforward and quick to navigate.
o Any modification to the parent node is reflected automatically in the child
node, ensuring data integrity.
⮚ Disadvantages
o Relationships that are complex are not supported.
o Because it only supports one parent per child node, if we have a complex
relationship in which a child node needs to have two parents, we won’t be
able to describe it using this model.
o When a parent node is removed, the child node is removed as well.

11. Network Data Model


⮚ The hierarchical model is extended in the network model. Prior to the relational
model, it was the most popular model.
⮚ To increase database performance and standards, the network model was devised to
express complicated data relationships more effectively than hierarchical models.

PREPARED BY – DR. MAITRI PATEL 11


⮚ It has entities that are grouped in a graphical format, and some of the entities can be
reached by many paths.
⮚ Example
⮚ Observe that the node student has two parents, CSE Department and Library, in the
example below. In the hierarchical model, this was previously impossible.

⮚ Features
o Multiple Paths
▪ There may be several paths to the same record due to the increased
number of relationships. It allows for quick and easy data access.
o The Ability to Merge More Relationships
▪ Data is more connected in this model since there are more
relationships. This paradigm can handle many-to-many as well as one-
to-one relationships.
o Circular Linked List
▪ The circular linked list is used to perform operations on the network
model. The present position is kept up to date with the help of a
software, and it navigates through the records based on the
relationship.
⮚ Advantages
o In comparison to the hierarchical model, data can be retrieved faster. This is
because the data in the network model is more related, and there may be more
than one path to a given node. As a result, the data can be accessed in a variety
of ways.
o Data integrity is present since there is a parent-child relationship. Any
changes to the parent record are mirrored in the child record.
⮚ Disadvantages
o As the number of relationships to be managed grows, the system may get
increasingly complicated. To operate with the model, a user must have a
thorough understanding of it.
o Any alteration, such as an update, deletion, or insertion, is extremely difficult.

12. Relational Data Model


⮚ Relational model makes the query much easier than in hierarchical or network
database systems. In 1970, E.F Codd has been developed it.

PREPARED BY – DR. MAITRI PATEL 12


⮚ A relational database is defined as a group of independent tables which are linked to
each other using some common fields of each related table. This model can be
represented as a table with columns and rows.
⮚ It is well known in database technology because it is usually used to represent real-
world objects and the relationships between them. Some popular relational
databases are used nowadays like Oracle, Sybase, DB2, MySQL Server etc.
⮚ Example – student relation
Stu_No S_Name PHONE_NO ADDRESS Gender

10112 Rama 9874567891 Islam ganj F

12839 Shyam 9026288936 Delhi M

33289 Laxman 8583287182 Gurugram M

27857 Mahesh 7086819134 Ghaziabad M

17282 Ganesh 9028939884 Delhi M


⮚ Relational Model Terminologies:
o Relation
▪ A relation is usually represented as a table.
▪ For example: student relation which contains tuples and attributes.
o Tuple
▪ The rows of a relation that contain the values corresponding to the
attributes are called tuples.
▪ For example: in the Student relation there are 5 tuples.
o Data Item
▪ The smallest unit of data in the relation is the individual data item. It
is stored at the intersection of rows and columns are also known as
cells.
▪ For Example: 10112, "Rama" etc are data items in Student relation.
o Attribute
▪ The smallest unit of data in relational model is an attribute. It contains
the name of a column in a particular table. Each attribute Ai must have
a domain, dom(Ai).
▪ For example: Stu_No, S_Name, PHONE_NO, ADDRESS, Gender
are the attributes of a student relation. In relational databases a column
entry in any row is a single value that contains exactly one item only.
o Domain
▪ It contains a set of atomic values that an attribute can take. It could be
accomplish explicitly by listing all possible values or specifying
conditions that all values in that domain must be confirmed.

PREPARED BY – DR. MAITRI PATEL 13


▪ For example: the domain of gender attributes is a set of data values
"M" for male and "F" for female. No database software fully supports
domains typically allowing the users to define very simple data types
such as numbers, dates, characters etc.
o Relation schema
▪ A relational schema contains the name of the relation and name of all
columns or attributes.
o Degree / Arity of a relation
▪ The degree of association is called the total number of attributes in a
relationship. The relation with one attribute is called unary relation,
with two attributes is known a binary relation and with three attributes
is known as ternary relation.
▪ For example: in the Student relation, the total number of attributes is
5, so the degree of the relations is 5. The degree of a relation does not
change with time as tuples get added or deleted.
o Cardinality
▪ The total number of rows at a time in a relation is called the cardinality
of that relation. For example: In a student relation, the total number of
tuples in this relation is3 so the cardinality of a relation is 3. The
cardinality of a relation changes with time as more and more tuples
get added or deleted.
o Relational database schema
▪ It is a set of relation schema and a set of integrity constraints.
o Relation state / Relation instance
▪ In the relational database system, the relational instance is represented
by a finite set of tuples. Relation instances do not have duplicate
tuples.
o Relational key
▪ In the relational key, each row has one or more attributes. It can
identify the row in the relation uniquely.
⮚ Properties of Relations
o Each attribute in a relation has only one data value corresponding to it i.e.
they do not contain two or more values.
o Name of the relation is distinct from all other relations.
o Each relation cell contains exactly one atomic (single) value
o Each attribute contains a distinct name
o Attribute domain has no significance
o Tuple has no duplicate value
o Order of tuple can have a different sequence
o It also provides information about metadata.
⮚ Merits
o This provides an abstract view of the data. It abstracts the physical structure
from the logical structure of data.

PREPARED BY – DR. MAITRI PATEL 14


o This model is very easy to design. Tables can use different attributes as per
requirements.
o The relational model supports data independence. In a relational database the
data is stored in tables so that we can modify the data without changing the
physical structure.
o Relational database helps the user to use a query language to query the
database.
o It offers more flexibility than other models.
o By moving sensitive attributes, we can also implement database security
control and authorization in a particular table into a separate relation with its
authorization controls.
o Relational database helps the user to use a query language to query the
database.
o A relational model consists of simple relationships. The characteristics of a
database that make it immune to certain maintenance problems have been
developed in the context of relational models.
o It is useful for representing most real world objects and the relationships
between them. It is very easy to implement a relationship through the use of
a composite key, so this model persistence method dominates the market.
⮚ Demerits
o The main disadvantage of relational models is that they do not support binary
data. For example: images, documents, spreadsheets etc.
o The relational model can easily adapt to new hardware so incurs large
hardware overhead.
o Relational databases use a simple mapping of logical tables to physical
structures.
o This mostly limits performance and allows non-relational systems such as
object oriented management systems to perform better on specialised
applications such as CAD, CAM etc.
o Enforcing data integrity in relational models is difficult because no single
piece of hardware has control over the data.
o The relational model is suitable for small databases but not suitable for
complex databases because the user needs to know the complex physical data
storage details. So, while designing the databases they don't come to light
when they may cause problems. When a database grows it will slow down
the system and will result in performance degradation and data corruption.
⮚ Operations on Relational Model
o Insertion Operation
o Deletion Operation
o Update Operation
o Retrieval Operation
⮚ Insert operation

PREPARED BY – DR. MAITRI PATEL 15


o It is used to insert a new record in the table. Adding new records to the table
is much easier than other models. Data values will not be found in a relation
when the following condition occurs:
o If we try to insert a duplicate value for the field that is selected as a primary
key.
o If we insert a NULL value in the attribute that contains primary key.
o If we try to enter a data value in the foreign key attribute that does not exist
in corresponding primary key attribute.
o If an attribute is assigned a value that does not exist in the corresponding
domain.
⮚ DELETE operation
o This operation is used to delete records from the table but problems arise
when the rows to be deleted have some attributes which are foreign key
attributes.
⮚ Update operation
o It is used to modify or change the data value of a record in a table. Updating
an attribute that is neither a primary key nor a foreign key requires only
checking that the new value is of the correct data type and domain. If we
modify a data value of a primary key and foreign key attribute then need to
check:
o The modified value does not contain the value of the corresponding foreign
key value.
o The new values must not already exist in the table.
⮚ Retrieval operation
o It is used to save a record from a relation. This operation is very simple and
homogeneous.

13. Entity-Relationship Data Model


⮚ ER model stands for an Entity-Relationship model. It is a high-level data model.
⮚ ER model is a diagrammatic representation of logical structure of database. E-R
model describes relationship among entities and attributes. Entity Relationship
Diagrams are the best tools to communicate within the entire system.
⮚ These diagrams are the graphical representation of the flow of data and information.
These diagrams are most commonly used in business organizations to make data
travel easy.
⮚ This conceptual database model is an effective way of communicating with the
individuals at all the levels. The most common use of this diagram is to present the
relation of the various tables present in a database.
⮚ Following are the main components and its symbols in ER Diagrams
o Rectangles
▪ This Entity Relationship Diagram symbol represents entity types
o Ellipses
▪ Symbol represent attributes

PREPARED BY – DR. MAITRI PATEL 16


o Diamonds
▪ This symbol represents relationship types
o Lines
▪ It links attributes to entity types and entity types with other
relationship types.
o Primary key
▪ Attributes are underlined
o Double Ellipses
▪ Represent multi-valued attributes

⮚ Components of E-R Diagram

PREPARED BY – DR. MAITRI PATEL 17


⮚ Entity
o It may be an object, person, place or event that stores data in a database. In
E-R diagram an entity is represented in rectangle form.
o For example, students, employees, managers, etc.

o Entity set
▪ It is a collection of entities of the same type which share similar
properties.
▪ For example, a group of students in a college and students are an entity
set.
o Entity is characterized into two types:
▪ Strong entity set
● The entity types which consist of key attributes or if there are
enough attributes for forming a primary key attribute are called
a strong entity set. It is represented by a single rectangle.

▪ Weak entity set


● An entity does not have a primary key attribute and depends on
another strong entity via foreign key attribute. It is represented
by a double rectangle.

⮚ Attributes
o Attributes are the data characteristics of entities or data elements and data
fields
o Types of attributes
▪ Single value attribute
● These attributes contain a single value. For example, age,
salary etc.
▪ Key Attributes
● 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.
▪ Multivalued attribute

PREPARED BY – DR. MAITRI PATEL 18


● They contain more than one value of a single entity. For
example, phone numbers, Email_Ids, etc.
▪ Composite attribute
● The attributes which can be further divided. For example,
Name consists of First name, Middle name, last name
▪ Derived attribute
● The attribute that can be derived from other attributes. For
example, age can be derived based on DoB
⮚ Relationships
o A relationship is used to describe the relation between entities. Diamond or
rhombus is used to represent the relationship.
o Degree of Relationship
▪ A relationship where a number of different entities set participate is
called a degree of a relationship
o It is categorised into the following:
▪ Unary Relationship
● A unary relationship exists when both the participating entity
type are the same. When such a relationship is present we say
that the degree of relationship is 1.
▪ Binary Relationship
● A binary relationship exists when exactly two entity type
participates. When such a relationship is present we say that the
degree is 2. This is the most common degree of relationship. It
is easy to deal with such relationship as these can be easily
converted into relational tables.
▪ Ternary Relationship
● A ternary relationship exists when exactly three entity type
participates. When such a relationship is present we say that the
degree is 3. As the number of entity increases in the
relationship, it becomes complex to convert them into
relational tables.
▪ n-ary Relationship
● An N-ary relationship exists when ‘n’ number of entities are
participating. So, any number of entities can participate in a
relationship. There is no limitation to the maximum number of
entities that can participate.
⮚ Mapping constraints
o A mapping constraint is a data constraint that expresses the number of entities
to which another entity can be related via a relationship set.
o It is most useful in describing the relationship sets that involve more than two
entity sets.
o For binary relationship set R on an entity set A and B, there are four possible
mapping cardinalities.

PREPARED BY – DR. MAITRI PATEL 19


▪ One-to-One (1:1)
▪ One-to-Many (1:M)
▪ Many-to-One (M:1)
▪ Many-to-Many (M:M)
o 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.
o 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.
o 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.
o 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.
⮚ Advantages of E-R Model
o Conceptually E-R model is very simple: ER model is very simple because if
we know relationship between entities and attributes, then we can easily draw
an ER diagram.
o Better Visual representation: ER model is a diagrammatic representation of
any logical structure of database. By seeing ER diagram, we can easily
understand relationship among entities and relationship.
o Effective communication tool: It is an effective communication tool for
database designer. The clear representation of the data listed under proper
headings and tables results in the effective flow of information and
communication.
o Highly integrated with relational model: ER model can be easily converted
into relational model by simply converting ER model into tables.
o Easy conversion to any data: ER model can be easily converted into another
data model like hierarchical data model, network data model and so on.
o Straightforward relation representation: Having designed an E-R diagram for
a database application, the relational representation of the database model
becomes relatively straightforward.
⮚ Disadvantages of E-R Model
o Limited constraints and specification: The constraints and specifications are
limited.
o Loss of information content: Some information be lost or hidden in ER
model.

PREPARED BY – DR. MAITRI PATEL 20


o Limited relationship representation: ER model represents limited relationship
as compared to another data models like relational model etc.
o No representation of data manipulation: It is difficult to show data
manipulation in ER model.
o No industry standard for notation.

14. Strong Entity Set VS. Weak Entity Set


Sr.
Strong entity set Weak entity set
No.
1. Strong entity set always has a Weak entity set does not have
primary key. enough attributes to build a
primary key.
2. It is represented by a rectangle It is represented by a double
symbol. rectangle symbol.
3. It contains a primary key It contains a partial key which is
represented by the underline represented by a dashed
symbol. underline symbol.
4. The member of a strong entity set The member of a weak entity set
is called as dominant entity set. called as a subordinate entity set.
5. Primary key is one of its In a weak entity set, it is a
attributes which helps to identify combination of primary key and
its member. partial key of the strong entity set.
6. In the ER diagram, the The relationship between one
relationship between two strong strong and a weak entity set
entity set shown by using a shown by using the double
diamond symbol. diamond symbol.
7. The connecting line of the strong The line connecting the weak
entity set with the relationship is entity set for identifying
single. relationship is double.

15. References
⮚ https://www.geeksforgeeks.org/
⮚ https://www.javatpoint.com/
⮚ https://byjus.com/
⮚ https://www.btechvibes.com/

PREPARED BY – DR. MAITRI PATEL 21

You might also like