SlideShare a Scribd company logo
Relational Algebra
What? Why? How? Presentation By:
Arman Hossain
CSE 11th Batch,
SMUCT, Dhaka
What is Relational Algebra?
Relational Algebra is procedural query language, which takes Relation as input and generate relation
as output. Relational algebra mainly provides theoretical foundation for relational databases and
SQL.
[ 1 ]
Why Relational Algebra?
 Once we have the data in a database, we want to access it.
 Relational algebra supports expressive queries by composing fairly simple operators.
 Only few operators needed.
 We need to know the operators for the schema refinement discussion.
[ 2 ]
How to use Relational Algebra?
Basic operations:
 Selection (  ): Selects a subset of rows from relation.
 Projection (  ): Deletes columns from relation.
 Cross-product (  ): Allows us to combine two relations.
 Rename Operation ( ρ ): Allows us to rename the output relation.
 Set-difference (  ): Tuples in relation 1, but not in relation 2.
 Union (  ): Tuples in relation 1 and in relation 2.
Additional operations:
 Intersection, join, division, renaming: Not essential, but (very) useful.
 Since each operation returns a relation, operations can be composed (Algebra is “closed”)
[ 3 ]
Select Operation ( σ )
ID Name Age
1 John 21
2 Samuel 19
3 Michael 17
Person σ Age > 17 (Person)
ID Name Age
1 John 21
2 Samuel 19
Relational AlgebraSource Result
Projection (  )
ID Name Mark
54 Frank 86
67 Ron 76
77 Jane 63
Student  ID, Name (Student)
ID Name
54 Frank
67 Ron
77 Jane
Relational AlgebraSource Result
Union Operation ( ∪ )
ID Name Jailed
1 Alan Burk 2
2 Lev Denz 4
3 Sam Stew 1
Criminal
 Name (Criminal) ∪  Name (Victim)
Relational AlgebraSource Result
Name
Sam Stew
Lev Denz
Victim
ID Name Loss
1 Den Sen 2200
2 Sam Stew 5800
3 Mark Nez 1000
4 Lev Denz 500
Set-Difference (  )
 Name (Criminal)   Name (Victim)
Relational AlgebraSource Result
Name
Alan Burk
ID Name Jailed
1 Alan Burk 2
2 Lev Denz 4
3 Sam Stew 1
Criminal
Victim
ID Name Loss
1 Den Sen 2200
2 Sam Stew 5800
3 Mark Nez 1000
4 Lev Denz 500
Cross-product (  )
ID Name Salary
13 Jefferson 6500
16 Richard 9000
19 Paronios 8100
Alpha
σ Salary > 8000 (Alpha  Beta)
Relational AlgebraSource Result
Beta
ID Name Salary
25 Dustinov 8500
36 Izinowa 4800
41 Denzikova 6700
ID Name Salary
16 Richard 9000
19 Paronios 8100
25 Dustinov 8500
Translation of Relational Algebra to SQL
 ID, Name (Student)
Relational Algebra Equivalent SQL
SELECT ID, Name FROM Student
σ Age > 17 (Person) SELECT * FROM Person WHERE Age > 17
 ID, Name σ Age > 17 (Person) SELECT ID, Name FROM Person WHERE Age > 17
Advantages of Relational Algebra
 The relational algebra has solid mathematical background.
 The mathematical background of relational algebra is the basis of many interesting developments
and theorems.
 If we have two expressions for the same operation and if the expressions are proved to be
equivalent, then a query optimizer can automatically substitute the more efficient form.
[ 4 ]
Limitations of Relational Algebra
 Although relational algebra seems powerful enough for most practical purposes, there are some
simple and natural operators on relations which cannot be expressed by relational algebra. The
transitive closure of a binary relation is one of them.
[ 5 ]
References:
[ 1 ] https://www.geeksforgeeks.org/database-management-system-relational-algebra/
[ 2 ] http://www.ccs.neu.edu/home/mirek/classes/2010-F-CS3200/Slides/Ch4_Algebra.pdf
[ 3 ] http://www.cs.cornell.edu/projects/btr/bioinformaticsschool/slides/gehrke.pdf
[ 4 ] https://www.scribd.com/presentation/63853016/Advantages-of-Relational-Algebra
[ 5 ] http://studylib.net/doc/9870912/limitations-of-relational-algebra

More Related Content

PPTX
Relational algebra ppt
PPT
Relational algebra in dbms
PDF
Relational algebra in dbms
PPTX
Expression and Operartor In C Programming
PPTX
Relational algebra
PPT
Regular expression with DFA
PPT
Operators in C Programming
PDF
Automata theory
Relational algebra ppt
Relational algebra in dbms
Relational algebra in dbms
Expression and Operartor In C Programming
Relational algebra
Regular expression with DFA
Operators in C Programming
Automata theory

What's hot (20)

PPTX
Chapter-7 Relational Calculus
PPTX
Top down parsing
PPTX
PPT
Operator Overloading
PDF
Symbol table in compiler Design
PPTX
Cursors, triggers, procedures
PDF
Issues in the design of Code Generator
PPTX
Matrix chain multiplication
PDF
Database System Architecture
PPTX
Asymptotic Notation
PPT
process creation OS
PPTX
Polymorphism in c++(ppt)
PPTX
System software - macro expansion,nested macro calls
PPTX
LISP: Introduction to lisp
PPTX
Deadlock Prevention
PPTX
1.10. pumping lemma for regular sets
PDF
List,tuple,dictionary
PPT
PL/SQL Introduction and Concepts
Chapter-7 Relational Calculus
Top down parsing
Operator Overloading
Symbol table in compiler Design
Cursors, triggers, procedures
Issues in the design of Code Generator
Matrix chain multiplication
Database System Architecture
Asymptotic Notation
process creation OS
Polymorphism in c++(ppt)
System software - macro expansion,nested macro calls
LISP: Introduction to lisp
Deadlock Prevention
1.10. pumping lemma for regular sets
List,tuple,dictionary
PL/SQL Introduction and Concepts
Ad

Similar to A simple presentation on Relational Algebra (20)

PPTX
Relational Algebra.Pptxjejejjdjdh jsjsjd
PPT
04 Introduction to SQ(Structural Query Language)L.ppt
PPTX
RDBMS
PDF
3.2 SQL to -Relational Algebra.pdf
PPTX
introduction to database system concepts 2
PPT
chapter 5-Relational Algebra and calculus.ppt
PDF
Chapter – 5 Relational Algebra.pdf
PDF
Expected questions for dbms
DOCX
Expected questions for dbms
PPT
ch14.ppt
PPT
UNIT 2 Structured query language commands
PPTX
Introduction to SQL- Database management System
PPT
Lecture 06 relational algebra and calculus
PPT
Intro to relational model
PPT
Mapping of Multivalued attributesER-to-Relational Mapping Algorithm.ppt
PPT
Mca ii-dbms- u-iii-sql concepts
PPTX
database chapter 6.pptx advanced database
PDF
chapter 6 Relational Algebra and calculus.pdf
PPT
Unit03 dbms
Relational Algebra.Pptxjejejjdjdh jsjsjd
04 Introduction to SQ(Structural Query Language)L.ppt
RDBMS
3.2 SQL to -Relational Algebra.pdf
introduction to database system concepts 2
chapter 5-Relational Algebra and calculus.ppt
Chapter – 5 Relational Algebra.pdf
Expected questions for dbms
Expected questions for dbms
ch14.ppt
UNIT 2 Structured query language commands
Introduction to SQL- Database management System
Lecture 06 relational algebra and calculus
Intro to relational model
Mapping of Multivalued attributesER-to-Relational Mapping Algorithm.ppt
Mca ii-dbms- u-iii-sql concepts
database chapter 6.pptx advanced database
chapter 6 Relational Algebra and calculus.pdf
Unit03 dbms
Ad

More from Arman Hossain (7)

PDF
5 Ways To Get More Impressions On LinkedIn
PPTX
Entity Relationship Diagram for Blogging Platform
PDF
Khudro Web Tunnel - Simple Tunneling
PPTX
Database of a Simple Social Network
PPTX
Automated Driver Fatigue Detection
PDF
Khude Barta - Online Messaging Application
PDF
System Analysis of OlpoKaj - A Local Micro Jobs Platform
5 Ways To Get More Impressions On LinkedIn
Entity Relationship Diagram for Blogging Platform
Khudro Web Tunnel - Simple Tunneling
Database of a Simple Social Network
Automated Driver Fatigue Detection
Khude Barta - Online Messaging Application
System Analysis of OlpoKaj - A Local Micro Jobs Platform

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Machine Learning_overview_presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25-Week II
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Review of recent advances in non-invasive hemoglobin estimation
Machine Learning_overview_presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.

A simple presentation on Relational Algebra

  • 1. Relational Algebra What? Why? How? Presentation By: Arman Hossain CSE 11th Batch, SMUCT, Dhaka
  • 2. What is Relational Algebra? Relational Algebra is procedural query language, which takes Relation as input and generate relation as output. Relational algebra mainly provides theoretical foundation for relational databases and SQL. [ 1 ]
  • 3. Why Relational Algebra?  Once we have the data in a database, we want to access it.  Relational algebra supports expressive queries by composing fairly simple operators.  Only few operators needed.  We need to know the operators for the schema refinement discussion. [ 2 ]
  • 4. How to use Relational Algebra? Basic operations:  Selection (  ): Selects a subset of rows from relation.  Projection (  ): Deletes columns from relation.  Cross-product (  ): Allows us to combine two relations.  Rename Operation ( ρ ): Allows us to rename the output relation.  Set-difference (  ): Tuples in relation 1, but not in relation 2.  Union (  ): Tuples in relation 1 and in relation 2. Additional operations:  Intersection, join, division, renaming: Not essential, but (very) useful.  Since each operation returns a relation, operations can be composed (Algebra is “closed”) [ 3 ]
  • 5. Select Operation ( σ ) ID Name Age 1 John 21 2 Samuel 19 3 Michael 17 Person σ Age > 17 (Person) ID Name Age 1 John 21 2 Samuel 19 Relational AlgebraSource Result
  • 6. Projection (  ) ID Name Mark 54 Frank 86 67 Ron 76 77 Jane 63 Student  ID, Name (Student) ID Name 54 Frank 67 Ron 77 Jane Relational AlgebraSource Result
  • 7. Union Operation ( ∪ ) ID Name Jailed 1 Alan Burk 2 2 Lev Denz 4 3 Sam Stew 1 Criminal  Name (Criminal) ∪  Name (Victim) Relational AlgebraSource Result Name Sam Stew Lev Denz Victim ID Name Loss 1 Den Sen 2200 2 Sam Stew 5800 3 Mark Nez 1000 4 Lev Denz 500
  • 8. Set-Difference (  )  Name (Criminal)   Name (Victim) Relational AlgebraSource Result Name Alan Burk ID Name Jailed 1 Alan Burk 2 2 Lev Denz 4 3 Sam Stew 1 Criminal Victim ID Name Loss 1 Den Sen 2200 2 Sam Stew 5800 3 Mark Nez 1000 4 Lev Denz 500
  • 9. Cross-product (  ) ID Name Salary 13 Jefferson 6500 16 Richard 9000 19 Paronios 8100 Alpha σ Salary > 8000 (Alpha  Beta) Relational AlgebraSource Result Beta ID Name Salary 25 Dustinov 8500 36 Izinowa 4800 41 Denzikova 6700 ID Name Salary 16 Richard 9000 19 Paronios 8100 25 Dustinov 8500
  • 10. Translation of Relational Algebra to SQL  ID, Name (Student) Relational Algebra Equivalent SQL SELECT ID, Name FROM Student σ Age > 17 (Person) SELECT * FROM Person WHERE Age > 17  ID, Name σ Age > 17 (Person) SELECT ID, Name FROM Person WHERE Age > 17
  • 11. Advantages of Relational Algebra  The relational algebra has solid mathematical background.  The mathematical background of relational algebra is the basis of many interesting developments and theorems.  If we have two expressions for the same operation and if the expressions are proved to be equivalent, then a query optimizer can automatically substitute the more efficient form. [ 4 ]
  • 12. Limitations of Relational Algebra  Although relational algebra seems powerful enough for most practical purposes, there are some simple and natural operators on relations which cannot be expressed by relational algebra. The transitive closure of a binary relation is one of them. [ 5 ]
  • 13. References: [ 1 ] https://www.geeksforgeeks.org/database-management-system-relational-algebra/ [ 2 ] http://www.ccs.neu.edu/home/mirek/classes/2010-F-CS3200/Slides/Ch4_Algebra.pdf [ 3 ] http://www.cs.cornell.edu/projects/btr/bioinformaticsschool/slides/gehrke.pdf [ 4 ] https://www.scribd.com/presentation/63853016/Advantages-of-Relational-Algebra [ 5 ] http://studylib.net/doc/9870912/limitations-of-relational-algebra