DBMS (1)

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 114

DBMS

Database management system is software that is


used to manage the database.
What is Data?

• Data is a collection of a distinct small unit of information. It can be


used in a variety of forms like text, numbers, media, bytes, etc. it can
be stored in pieces of paper or electronic memory, etc.
• Word 'Data' is originated from the word 'datum' that means 'single
piece of information.' It is plural of the word datum.
• In computing, Data is information that can be translated into a form
for efficient movement and processing. Data is interchangeable.
What is Database

• The database is a collection of inter-related data which is used to


retrieve, insert and delete the data efficiently.
• It is also used to organize the data in the form of a table, schema,
views, and reports, etc.
• For example: The college Database organizes the data about the
admin, staff, students and faculty etc.
• Using the database, you can easily retrieve, insert, and delete the
information.
Database Management System

• Database management system is a software which is used to manage


the database.
• For example: MySQL, Oracle, etc are a very popular commercial
database which is used in different applications.
• DBMS provides an interface to perform various operations like
database creation, storing data in it, updating data, creating a table in
the database and a lot more.
• It provides protection and security to the database. In the case of
multiple users, it also maintains data consistency.
DBMS allows users the following tasks:
• Data Definition: It is used for creation, modification, and removal of
definition that defines the organization of data in the database.
• Data Updation: It is used for the insertion, modification, and deletion
of the actual data in the database.
• Data Retrieval: It is used to retrieve the data from the database which
can be used by applications for various purposes.
• User Administration: It is used for registering and monitoring users,
maintain data integrity, enforcing data security, dealing with
concurrency control, monitoring performance and recovering
information corrupted by unexpected failure.
Characteristics of DBMS
• It uses a digital repository established on a server to store and manage the
information.
• It can provide a clear and logical view of the process that manipulates data.
• DBMS contains automatic backup and recovery procedures.
• It contains ACID properties which maintain data in a healthy state in case
of failure.
• It can reduce the complex relationship between data.
• It is used to support manipulation and processing of data.
• It is used to provide security of data.
• It can view the database from different viewpoints according to the
requirements of the user.
Advantages of DBMS
• Controls database redundancy: It can control data redundancy because it
stores all the data in one single database file and that recorded data is placed in
the database.
• Data sharing: In DBMS, the authorized users of an organization can share the
data among multiple users.
• Easily Maintenance: It can be easily maintainable due to the centralized
nature of the database system.
• Reduce time: It reduces development time and maintenance need.
• Backup: It provides backup and recovery subsystems which create automatic
backup of data from hardware and software failures and restores the data if
required.
• multiple user interface: It provides different types of user interfaces like
graphical user interfaces, application program interfaces
Disadvantages of DBMS
• Cost of Hardware and Software: It requires a high speed of data
processor and large memory size to run DBMS software.
• Size: It occupies a large space of disks and large memory to run them
efficiently.
• Complexity: Database system creates additional complexity and
requirements.
• Higher impact of failure: Failure is highly impacted the database
because in most of the organization, all the data stored in a single
database and if the database is damaged due to electric failure or
database corruption then the data may be lost forever.
Application of DBMS
• Railway Reservation System –
In the rail route reservation framework, the information base is needed
to store the record or information of ticket appointments, status about
train’s appearance, and flight. Additionally, if trains get late,
individuals become acquainted with it through the information base
update.

• Banking –
Database the executive’s framework is utilized to store the exchange
data of the client in the information base.
• Library Management System –
There are lots of 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.

• Credit card exchanges –


The database Management framework is utilized for buying on charge
cards and age of month to month proclamations.
• Education Sector –
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.
• Broadcast communications –
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 postpaid
bills in the information base.
• Online Shopping –
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, installments, buy data these are
finished with the assistance of DBMS.
• Social Media Sites –
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 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.
• Manufacturing –
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 –


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: DBMS is used in healthcare to manage patient data,
medical records, and billing information.
Data retrieval: DBMS provides a way to retrieve data quickly and
easily using search queries.
Data manipulation: DBMS provides tools to manipulate data, such as
sorting, filtering, and aggregating data.
Security: DBMS provides security features to ensure that only
authorized users have access to the data.
Data backup and recovery: DBMS provides tools to back up data and
recover it in case of system failures or data loss.

Multi-user access: DBMS allows multiple users to access and modify


data simultaneously.

Reporting and analysis: DBMS provides tools to generate reports and


analyze data to gain insights and make informed decisions.
Evolution of Databases

• The database has completed more than 50 years of journey of its


evolution from flat-file system to relational and objects relational
systems. It has gone through several generations.
File-Based

• 1968 was the year when File-Based database were introduced. In file-
based databases, data was maintained in a flat file. Though files have
many advantages, there are several limitations.
• One of the major advantages is that the file system has various access
methods, e.g., sequential, indexed, and random.
• It requires extensive programming in a third-generation language such
as COBOL, BASIC.
Hierarchical Data Model

• 1968-1980 was the era of the Hierarchical Database. Prominent


hierarchical database model was IBM's first DBMS. It was called IMS
(Information Management System).
• In this model, files are related in a parent/child manner.
• Below diagram represents Hierarchical Data Model. Small circle
represents objects.
Network data model

• Charles Bachman developed the first DBMS at Honeywell called


Integrated Data Store (IDS). It was developed in the early 1960s, but it
was standardized in 1971 by the CODASYL group (Conference on
Data Systems Languages).
• In this model, files are related as owners and members, like to the
common network model.
Relational Database
• 1970 - Present: It is the era of Relational Database and Database
Management. In 1970, the relational model was proposed by E.F. Codd.
• Relational database model has two main terminologies called instance and
schema.
• The instance is a table with rows or columns
• Schema specifies the structure like name of the relation, type of each
column and name.
• This model uses some mathematical concept like set theory and predicate
logic.
• The first internet database application had been created in 1995.
• During the era of the relational database, many more models had introduced
like object-oriented model, object-relational model, etc.
Cloud database
• Cloud database facilitates you to store, manage, and retrieve their
structured, unstructured data via a cloud platform. This data is
accessible over the Internet. Cloud databases are also called a database
as service (DBaaS) because they are offered as a managed service.
• Some best cloud options are:
• AWS (Amazon Web Services)
• Snowflake Computing
• Oracle Database Cloud Services
• Microsoft SQL server
• Google cloud spanner
The Object-Oriented Databases

• The object-oriented databases contain data in the form of object and


classes.
• Objects are the real-world entity, and types are the collection of
objects.
• An object-oriented database is a combination of relational model
features with objects oriented principles.
• It is an alternative implementation to that of the relational model.
• The object-oriented database model contains the following properties.
• Object-oriented programming properties
• Objects
• Classes
• Inheritance
• Polymorphism
• Encapsulation
• Relational database properties
• Atomicity
• Consistency
• Integrity
• Durability
• Concurrency
• Query processing
There are the following differences
between DBMS and File systems:
Basis DBMS Approach File System Approach

Meaning DBMS is a collection of data. In DBMS, the The file system is a collection of data.
user is not required to write the procedures. In this system, the user has to write
the procedures for managing the
database.

Sharing of data Due to the centralized approach, data Data is distributed in many files, and
sharing is easy. it may be of different formats, so it
isn't easy to share data.

Data Abstraction DBMS gives an abstract view of data that The file system provides the detail of
hides the details. the data representation and storage of
data.
Security and DBMS provides a good protection It isn't easy to protect a file under the file
Protection mechanism. system.
Recovery DBMS provides a crash recovery The file system doesn't have a crash
Mechanism mechanism, i.e., DBMS protects the user mechanism, i.e., if the system crashes
from system failure. while entering some data, then the content
of the file will be lost.

Manipulation DBMS contains a wide variety of The file system can't efficiently store and
Techniques sophisticated techniques to store and retrieve the data.
retrieve the data.
Concurrency DBMS takes care of Concurrent access of In the File system, concurrent access has
Problems data using some form of locking. many problems like redirecting the file
while deleting some information or
updating some information.
Where to use Database approach used in large systems File system approach used in
which interrelate many files. large systems which interrelate
many files.
Cost The database system is expensive to The file system approach is
design. cheaper to design.
Data Redundancy and Due to the centralization of the database, In this, the files and application
Inconsistency
the problems of data redundancy and programs are created by different
inconsistency are controlled. programmers so that there exists
a lot of duplication of data which
may lead to inconsistency.

Structure The database structure is complex to The file system approach has a
design. simple structure.
Data Independence •In this system, Data In the File system approach,
Independence exists, and it can there exists no Data
be of two types.Logical Data Independence.
Independence
•Physical Data Independence
Integrity Constraints Integrity Constraints are easy to Integrity Constraints are difficult
apply. to implement in file system.

Data Models •In the database approach, 3 In the file system approach, there
types of data models is no concept of data models
exist:Hierarchal data models exists.
•Network data models
•Relational data models
Flexibility Changes are often a necessity to the content of The flexibility of the system is less as
the data stored in any system, and these compared to the DBMS approach.
changes are more easily with a database
approach.

Examples Oracle, SQL Server, Sybase etc. Cobol, C++ etc.


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.
• Therefore, there are following four data models used for
understanding the structure of the database:
• 1) Relational Data Model: 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.
• 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.
• The main highlights of this model are −
• Data is stored in tables called relations.
• Relations can be normalized.
• In normalized relations, values saved are atomic values.
• Each row in a relation contains a unique value.
• Each column in a relation contains values from a same domain.
• 2) Entity-Relationship Data Model: 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.
• 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'.
• Entity − An entity in an ER Model is a real-world entity having
properties called attributes. Every attribute is defined by its set of
values called domain.
• For example, in a school database, a student is considered as an entity.
Student has various attributes like name, age, class, etc.
• Relationship − The logical association among entities is
called relationship. Relationships are mapped with entities in various
ways. Mapping cardinalities define the number of association between
two entities.
• Mapping cardinalities −
• one to one
• one to many
• many to one
• many to many
• 3) Object-based 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.
• Thus, in 1980s, various database systems following the object-oriented
approach were developed.
• Here, the objects are nothing but the data carrying its properties.
• 4) Semistructured Data Model: This type of data model is different
from the other three data models (explained above).
• The semistructured 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 semistructured 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.
• Advantages of Data Models
1.Data Models help us in representing data accurately.
2. It helps us in finding the missing data and also in minimizing Data
Redundancy.
3.Data Model provides data security in a better way.
• Disadvantages of Data Models
1.In the case of a vast database, sometimes it becomes difficult to
understand the data model.
2.You must have the proper knowledge of SQL to use physical models.
Data Abstraction in DBMS

• Data abstraction is the procedure of concealing irrelevant or unwanted


data from the end user.
• Let us understand this with an example, if you go to a shop to buy a
pair of shoes, you ask the shopkeeper to show you the shoes of a
certain company, and you also tell the shopkeeper about the size,
color, and material you want.
• Then, you will only see the specified things in the shoes, or will you
be asking the shopkeeper questions such as, where are these shoes
made? From where does the material come? What is the cost of the
material?
• The answer to these questions is NO.
• You will not ask these questions because these questions are of no use.
• You do not care about these questions.
• You are only concerned about a few things, such as the company, size,
color, material, and how the shoes look.
• That is why these unimportant details are kept hidden from the end user.
• This is the process we call data abstraction.
What is Data abstraction in Database Management System?

• The database system contains intricate data structures and relations.


• The developers keep away the complex data from the user and remove
the complications so that the user can comfortably access data in the
database and can only access the data they want, which is done with
the help of data abstraction.
• The main purpose of data abstraction is to hide irrelevant data and
provide an abstract view of the data.
• With the help of data abstraction, developers hide irrelevant data from
the user and provide them the relevant data. By doing this, users can
access the data without any hassle, and the system will also work
efficiently.
• In DBMS, data abstraction is performed in layers which means there
are levels of data abstraction in DBMS that we will further study in
this article.
• Based on these levels, the database management system is designed.
Levels of Data Abstractions in DBMS

• In DBMS, there are three levels of data abstraction, which are as


follows:
1. Physical or Internal Level:

• The physical or internal layer is the lowest level of data abstraction in the
database management system.
• It is the layer that defines how data is actually stored in the database. It
defines methods to access the data in the database.
• It defines complex data structures in detail, so it is very complex to
understand, which is why it is kept hidden from the end user.
• Data Administrators (DBA) decide how to arrange data and where to store
data.
• The Data Administrator (DBA) is the person whose role is to manage the
data in the database at the physical or internal level.
• There is a data center that securely stores the raw data in detail on hard
drives at this level.
2. Logical or Conceptual Level:

• The logical or conceptual level is the intermediate or next level of data


abstraction.
• It explains what data is going to be stored in the database and what the
relationship is between them.
• It describes the structure of the entire data in the form of tables.
• The logical level or conceptual level is less complex than the physical
level.
• With the help of the logical level, Data Administrators (DBA) abstract
data from raw data present at the physical level.
3. View or External Level:

• View or External Level is the highest level of data abstraction.


• There are different views at this level that define the parts of the
overall data of the database.
• This level is for the end-user interaction; at this level, end users can
access the data based on their queries.
Advantages of data abstraction in DBMS

• Users can easily access the data based on their queries.


• It provides security to the data stored in the database.
• Database systems work efficiently because of data abstraction.
Conclusion:
• In this data abstraction, which means hiding unwanted details from the
end user.
• The three levels of data abstraction in DBMS: the physical or internal
level, the logical or conceptual level, and the visual or external level.
• The physical or internal level describes how data can be stored in the
database.
• The logical or conceptual level describes the data being stored in the
database.
• The view or external level represents multiple views that users can
access based on their questions.
Data Independence

• Data independence can be explained using the three-schema


architecture.
• Data independence refers characteristic of being able to modify the
schema at one level of the database system without altering the
schema at the next higher level.
There are two types of data independence:
• 1. Logical Data Independence
• Logical data independence refers characteristic of being able to change
the conceptual schema without having to change the external schema.
• Logical data independence is used to separate the external level from
the conceptual view.
• If we do any changes in the conceptual view of the data, then the user
view of the data would not be affected.
• Logical data independence occurs at the user interface level.
2. Physical Data Independence

• Physical data independence can be defined as the capacity to change


the internal schema without having to change the conceptual schema.
• If we do any changes in the storage size of the database system server,
then the Conceptual structure of the database will not be affected.
• Physical data independence is used to separate conceptual levels from
the internal levels.
• Physical data independence occurs at the logical interface level.
Structure of DBMS
DBMS

• DBMS means Database Management System, which is a tool or


software used to create the database or delete or manipulate the
database.
• A software programme created to store, retrieve, query, and manage
data is known as a Database Management System (DBMS).
• Data can be generated, read, updated, and destroyed by authorized
entities thanks to user interfaces (UIs).
• Because they give programmers, Database Managers, and end users a
consolidated view of the data, Database Management Systems are
crucial because they relieve applications and end users of the need to
comprehend the physical location of the data.
• Application Programme Interfaces (APIs) manage internet requests
and responses for particular sorts of data.
• In marketing materials, the phrase "database as a service" (DBaaS)
may be used to refer to both relational and non-relational DBMS
components that are given via the internet.
• Users of DBMSs include application programmers, Database
Administrators (DBAs), and end users.
• Database Administrators are typically the only people who work
directly with a DBMS.
• Today, end users read and write to databases using front-end interfaces
made by programmers, while programmers use cloud APIs to connect
with DBMSs.
• Three Parts that make up the Database System are:
• Query Processor
• Storage Manager
• Disk Storage
1. Query Processor:
• It interprets the requests (queries) received from end user via an
application program into instructions. It also executes the user request
which is received from the DML compiler.

Query Processor contains the following components –


• DML Compiler: It processes the DML statements into low level
instruction (machine language), so that they can be executed.
• DDL Interpreter: It processes the DDL statements into a set of table
containing meta data (data about data).
• Embedded DML Pre-compiler: It processes DML statements
embedded in an application program into procedural calls.
• Query Optimizer: It executes the instruction generated by DML
Compiler.
2. Storage Manager:

• An application called Storage Manager acts as a conduit between the


queries made and the data kept in the database.
• Another name for it is Database Control System.
• By applying the restrictions and running the DCL instructions, it keeps
the database's consistency and integrity.
• It is in charge of retrieving, storing, updating, and removing data from
the database.
Components of Storage Manager

• Following are the components of Storage Manager:


• Integrity Manager:
• Whenever there is any change in the database, the Integrity manager will
manage the integrity constraints.
• Authorization Manager:
• Authorization manager verifies the user that he is valid and authenticated
for the specific query or request.
• File Manager:
• All the files and data structure of the database are managed by this
component.
• Transaction Manager:
• It is responsible for making the database consistent before and after
the transactions. Concurrent processes are generally controlled by this
component.
• Buffer Manager:
• The transfer of data between primary and main memory and managing
the cache memory is done by the buffer manager.
3. Disk Storage

• A DBMS can use various kinds of Data Structures as a part of physical


system implementation in the form of disk storage.

• Components of Disk Storage


• Data Dictionary:
• It contains the metadata (data of data), which means each object of the
database has some information about its structure. So, it creates a repository
which contains the details about the structure of the database object.
• Data Files:
• This component stores the data in the files.
• Indices:
• These indices are used to access and retrieve the data in a very fast and
efficient way.
ER (Entity Relationship) Diagram in DBMS

• ER model stands for an Entity-Relationship model. It is a high-level


data model. This model is used to define the data elements and
relationship for a specified system.
• It develops a conceptual design for the database. It also develops a
very simple and easy to design view of data.
• 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.
• 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.
• Strong Entity
• The strong entity has a primary key. Weak entities are dependent on
strong entity. Its existence is not dependent on any other entity.
• Strong Entity is represented by a single rectangle −
• Weak Entity
• The weak entity in DBMS do not have a primary key and are
dependent on the parent entity. It mainly depends on other entities.
• Weak Entity is represented by double rectangle −
Example of Strong and Weak Entity
Attribute

• 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.
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.
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.
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.
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.
Features of ER model

• The extended E-R features are


• specialization,
• generalization,
• higher- and lower-level entity sets,
• attribute inheritance, and
• aggregation.
• Specialization – An entity set broken down sub-entities that are
distinct in some way from other entities in the set. For instance, a
subset of entities within an entity set may have attributes that are not
shared by all the entities in the entity set. The E-R model provides a
means for representing these distinctive entity groupings.
• Specialization is an “a Top-down approach” where a high-level entity
is specialized into two or more level entities.
• Example – Consider an entity set vehicle, with attributes color and no.
of tires. A vehicle may be further classified as one of the following:
• Car
• Bike
• Bus
• Each of these vehicle types is described by a set of attributes that
includes all the attributes of the entity set vehicle plus possibly
additional attributes.

• For example, car entities may be described further by the attribute


gear, whereas bike entities may be described further by the attributes
automatic break. The process of designating subgroupings within an
entity set is called specialization. The specialization of vehicles allows
us to distinguish among vehicles according to whether they are cars,
buses, or bikes.
• Generalization – It is a process of extracting common properties from
a set of entities and creating a generalized entity from it.
Generalization is a “Bottom-up approach”. In which two or more
entities can be combined to form a higher-level entity if they have
some attributes in common.
• In generalization, Subclasses are combined to make a superclass.
• Example: There are three entities given, car, bus, and bike. They all
have some common attributes like all cars, buses, and bikes they all
have no. of tires and have some colors. So they all can be grouped and
make a superclass named a vehicle.
• Inheritance – An entity that is a member of a subclass inherits all the
attributes of the entity as the member of the superclass, the entity also
inherits all the relationships that the superclass participates in.
Inheritance is an important feature of Generalization and
Specialization. It allows lower-level entities to inherit the attributes of
higher-level entities.
• Example – Car, bikes, and buses inherit the attributes of a vehicle.
Thus, a car is described by its color and no. of tires, and additionally a
gear attribute; a bike is described by its color and no. of tires
attributes, and additionally automatic break attribute.
• Aggregation – In aggregation, the relation between two entities is
treated as a single entity. In aggregation, the relationship with its
corresponding entities is aggregated into a higher-level entity.
• Example- phone numbers on your mobile phone. You can refer to
them individually – your mother’s number, your best friend’s number,
etc. But it’s easier to think of them collectively, as your phone number
list. It is also important to realize that each member of the aggregation
still has the properties of the whole. In other words, each phone
number in the list remains a phone number. The process of combining
them has not altered them in any way.
higher- and lower-level entity sets,
• This property is created by specialization and generalization. The
attributes of higher level entity sets are inherited by lower level entity
sets.
• For example: In above figure “customers” and “employee” inherits the
attributes of “person”.
Features of ER model

• i) E-R diagrams are used to represent E-R model in a database, which


makes them easy to be converted into relations (tables).
• ii) E-R diagrams provide the purpose of real-world modeling of
objects which makes them intently useful.
• iii) E-R diagrams require no technical knowledge and no hardware
support.
• iv) These diagrams are very easy to understand and easy to create even
by a naive user
• v) It gives a standard solution of visualizing the data logically.
Entity, Entity Type, Entity Set –
• An Entity may be an object with a physical existence – a particular
person, car, house, or employee – or it may be an object with a
conceptual existence – a company, a job, or a university course.
• An Entity is an object of Entity Type and a set of all entities is called
as an entity set. e.g.; E1 is an entity having Entity Type Student and set
of all students is called Entity Set. In ER diagram, Entity Type is
represented as:
Relational Algebra

• Relational algebra is a procedural query language.


• It gives a step by step process to obtain the result of the query.
• It uses operators to perform queries.
• Relational algebra mainly provides a theoretical foundation for
relational databases and SQL.
• The main purpose of using Relational Algebra is to define operators
that transform one or more input relations into an output relation.
Types of Relational operation
• These are the basic/fundamental operators used in Relational Algebra.
1.Selection(σ)
2.Projection(π)
3.Union(U)
4.Set Difference(-)
5.Set Intersection(∩)
6.Rename(ρ)
7.Cartesian Product(X)
• 1. Selection(σ): It is used to select required tuples of the relations.
• 2. Projection(π): It is used to project required column data from a
relation.
• 3. Union(U): Union operation in relational algebra is the same as
union operation in set theory.
• 4. Set Difference(-): Set Difference in relational algebra is the same
set difference operation as in set theory.
• 5. Set Intersection(∩): Set Intersection in relational algebra is the
same set intersection operation in set theory.
• 6. Rename(ρ): Rename is a unary operation used for renaming
attributes of a relation.
• 7. Cross Product(X): Cross-product between two relations. Let’s say
A and B, so the cross product between A X B will result in all the
attributes of A followed by each attribute of B. Each record of A will
pair with every record of B.

You might also like