SlideShare a Scribd company logo
1 of 29
RELATION
AL
ALGEBRA
Module 2
MEMBERS:
• Karen G. Comandante
• Jerette-Jean Baker
• Prince Carl S. Ajoc
• Buenaflor
INTRODUCTION
Relational algebra is a collection
of operations used to manipulate
relations (tables) in relational
databases.
INTRODUCTION
• It was established by
E.F. Codd in 1971 as
the foundation for
query languages like
SQL.
INTRODUCTION
Think of it as a "procedural
language" that instructs the
database system on how to
construct new relations from
existing ones.
SELECTION
• Select operation chooses the subset of
tuples from the relation that satisfies the
given condition mentioned in the syntax of
selection.
• The selection operation is also known as
horizontal partitioning since it partitions the
table or relation horizontally.
KEY POINTS
• Relational algebra: focuses on
operations and logic.
• SQL: adds syntax, keywords, and
features specific to a particular
database system.
Differentiation from SQL's SELECT statement:
KEY POINTS
• where ‘c’ is selection condition which is a
boolean expression(condition), we can have a
single condition like Roll= 3 or combination of
condition like X>2 AND Y<1, symbol ‘σ (sigma)’
is used to denote select(choose) operator, R is a
relational algebra expression, whose result is a
relation.
Notation:
KEY POINTS
Correspondence:
• in SQL corresponds to selection in relational
algebra.
• * means all attributes, similar to selecting all
columns.
KEY POINTS
Example:
• Consider a relation Customers
with attributes name, city, and
age.
KEY POINTS
Example:
Selection Query:
• This retrieves all customers who
live in New York and are older
than 25.
PROJECTION
OPERATION
Jerette-Jean Baker
PROJECTION
OPERATION
The Projection operation works on a single
relation R and defines a relation that
contains a vertical subset of R, extracting
the values of specified attributes and
eliminating duplicates.
PROJECTION
OPERATION
Notation:
• where ‘A’ is the attribute list, it is the desired set of attributes
from the attributes of relation(R).
• Symbol ‘π(pi)’ is used to denote the Project operator, R is
generally a relational algebra expression, which results in a
relation.
PROJECTION
OPERATION
Example:
• Given a relation Faculty (Class, Dept, Position) with the following
tuples:
PROJECTION
OPERATION
Example:
• Given a relation Faculty (Class, Dept, Position) with the following
tuples:
Notation:
PROJECTION
OPERATION
Input Output
SET OPERATIONS
Union
• For R ∪ S, The union of two relations, R
and S, defines a relation that contains all
the tuples of R, or S, or both R and S,
duplicate tuples being eliminated. R and S
must be union-compatible.
SET OPERATIONS
Info_tb1 Info_tb2
SET OPERATIONS
Info_tb1 Info_tb2
SET OPERATIONS
The intersection of the sets A and B,
denoted by A ∩ B, is the set of elements
that belong to both A and B i.e. set of
the common elements in A and B.
Intersection
SET OPERATIONS
Info_tb1 Info_tb2
SET OPERATIONS
Difference
The difference between sets is denoted
by ‘A – B’, which is the set containing
elements that are in A but not in B. i.e.,
all elements of A except the element of
B.
SET OPERATIONS
Info_tb1 Info_tb2
JOINS
Prince Carl S. Ajoc
JOINS
A JOIN clause is used to combine
rows from two or more tables,
based on a related column
between them.
JOINS
JOINS
Notice that the "CustomerID"
column in the "Orders" table
refers to the "CustomerID" in
the "Customers" table. The
relationship between the two
tables above is the
"CustomerID" column.
JOINS
Then, we can create the following SQL statement (that contains an
INNER JOIN), that selects records that have matching values in both
tables:

More Related Content

Similar to Info_Management_report-1.pptx

E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
Mukund Trivedi
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
Mukund Trivedi
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
10GUPTASOUMYARAMPRAK
 
Relational operation final
Relational operation finalRelational operation final
Relational operation final
Student
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 
1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf
Kavinilaa
 
Relational_Algebra_Calculus Operations.pdf
Relational_Algebra_Calculus Operations.pdfRelational_Algebra_Calculus Operations.pdf
Relational_Algebra_Calculus Operations.pdf
Christalin Nelson
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
Nalina Kumari
 

Similar to Info_Management_report-1.pptx (20)

E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
 
354 ch6
354 ch6354 ch6
354 ch6
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
 
Chapter-6 Relational Algebra
Chapter-6 Relational AlgebraChapter-6 Relational Algebra
Chapter-6 Relational Algebra
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
 
316_16SCCCS4_2020052505222431.pptdatabasex
316_16SCCCS4_2020052505222431.pptdatabasex316_16SCCCS4_2020052505222431.pptdatabasex
316_16SCCCS4_2020052505222431.pptdatabasex
 
Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013Dbms ii mca-ch5-ch6-relational algebra-2013
Dbms ii mca-ch5-ch6-relational algebra-2013
 
Relational Algebra Operations
Relational Algebra OperationsRelational Algebra Operations
Relational Algebra Operations
 
Relational data model
Relational data modelRelational data model
Relational data model
 
Relational operation final
Relational operation finalRelational operation final
Relational operation final
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf1695304562_RELATIONAL_ALGEBRA.pdf
1695304562_RELATIONAL_ALGEBRA.pdf
 
Relational_Algebra_Calculus Operations.pdf
Relational_Algebra_Calculus Operations.pdfRelational_Algebra_Calculus Operations.pdf
Relational_Algebra_Calculus Operations.pdf
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 

More from ChingChingErm (6)

history_of_kkkdrfthaerdthgEWRHGADRTHADFAHERHAEDRFHADFHGRTEHASDRFH.pptx
history_of_kkkdrfthaerdthgEWRHGADRTHADFAHERHAEDRFHADFHGRTEHASDRFH.pptxhistory_of_kkkdrfthaerdthgEWRHGADRTHADFAHERHAEDRFHADFHGRTEHASDRFH.pptx
history_of_kkkdrfthaerdthgEWRHGADRTHADFAHERHAEDRFHADFHGRTEHASDRFH.pptx
 
Data Mining Presentation.pptx
Data Mining Presentation.pptxData Mining Presentation.pptx
Data Mining Presentation.pptx
 
PE Report.pptx
PE Report.pptxPE Report.pptx
PE Report.pptx
 
Data Structures and Algorithms presentation.pptx
Data Structures and Algorithms presentation.pptxData Structures and Algorithms presentation.pptx
Data Structures and Algorithms presentation.pptx
 
RecursiveBinarySearch.pptx
RecursiveBinarySearch.pptxRecursiveBinarySearch.pptx
RecursiveBinarySearch.pptx
 
Data Structures and Algorithms presentation.pptx
Data Structures and Algorithms presentation.pptxData Structures and Algorithms presentation.pptx
Data Structures and Algorithms presentation.pptx
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Info_Management_report-1.pptx