SlideShare a Scribd company logo
2. Relational Algebra
Definition:
The basic set of operations for the relational model. And a user
enable to specify basic retrieval requests.
☞ The algebra operations produce new relations, which can be
further manipulated using operations of the same algebra.
☞ A sequence forms a relational algebra expression
☞ Has a procedural paradigm: you need to tell what/how to
construct the result
2. Relational Algebra
Basic Relational Operation:
◆ Unary operations
Select: σ.
Project: or π.
The rename operator: ρ.
◆ Binary operations
Set operations:
Union:
Intersection:
Difference: –
Cartesian product
Join operations:
2. Relational Algebra
◆ Unary operations
Select Operation:
Used to select a subset of the tuples from a relation that satisfy a
selection condition. It is a filter that keeps only those tuples that
satisfy a qualifying condition.
Example
To select the employee tuples whose department number is four or those
whose salary is greater than $30,000 the following notation is used:
Σdno = 4 (employee)
Σsalary > 30,000 (employee)
In general, the select operation is denoted by σ <selection condition>(r)
where the symbol σ (sigma) is used to denote the select operator, and the
selection condition is a boolean expression specified on the attributes of
relation r.
2. Relational Algebra
Rename Operation:
To apply several relational algebra operations one after the other.
Relational algebra expression by nesting the operations, or
apply one operation at a time and create intermediate result
relations. In the latter case, we must give names to the relations
that hold the intermediate results.

Example
To retrieve the first name, last name, and salary of all employees who
work in department number 5, we must apply a select and a project
operation. We can write a single relational algebra expression as follows:
Πfname, lname, salary(σ dno=5(employee))
Or explicitly show the sequence of operations, giving a name to each
Intermediate relation:
Dep5_emps ← σ dno=5(employee)
Result ← π fname, lname, salary (dep5_emps)
2. Relational Algebra
◆ Binary Relational Operations
▪ Relational Algebra Operations from Set theory
Union Operation:
Denoted by r
s, is a relation that includes all tuples that are
either in r or in s or in both r and s.
Example
To retrieve the social security numbers of all employees who either work
in department 5 or directly supervise an employee who works in
department 5, we can use the union operation as follows:
Dep5_emps ← σdno=5 (employee)
Result1 ← π ssn(dep5_emps)
Result2(ssn) ← π superssn(dep5_emps)
Result ← result1 result2
The union operation produces the tuples that are in either result1 or
result2 or both. The two operands must be “type compatible”.
2. Relational Algebra

Student

instructor.
2. Relational Algebra
Join Operation:
• The sequence of Cartesian product followed by select is used
quite commonly to identify and select related tuples from two
relations, a special operation, called join. It is denoted by a
.
• This operation is very important for any relational database with
more than a single relation, because it allows us to process
relationships among relations.
• The general form of a join operation on two relations
r(a1, a2, . . ., an) and s(b1, b2, . . ., bm) is:
R

<join condition>s

Where r and s can be any relations that result from general
relational algebra expressions.
2. Relational Algebra
Join Operation:
Example:
Suppose that we want to retrieve the name of the manager of each
department. To get the manager’s name, we need to combine each
department tuple with the employee tuple whose ssn value matches the
mgrssn value in the department tuple.

We do this by using the join
Dept_mgr ← department

operation.
mgrssn=ssn(mployee).

More Related Content

What's hot

Python operators
Python operatorsPython operators
Python operators
nuripatidar
 
Operators in python
Operators in pythonOperators in python
Operators in python
eShikshak
 
Relational operators
Relational operatorsRelational operators
Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vb
alldesign
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
Deepak Singh
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
Huda Alameen
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
vishaljot_kaur
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
Abhilash Nair
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in C
Prabhu Govind
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
Online
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
Pranav Ghildiyal
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
Anusuya123
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
Shyam Sir
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
operators in c++
operators in c++operators in c++
operators in c++
Kartik Fulara
 
Operators and Expression
Operators and ExpressionOperators and Expression
Operators and Expression
shubham_jangid
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++
zeeshan turi
 

What's hot (18)

Python operators
Python operatorsPython operators
Python operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Relational operators
Relational operatorsRelational operators
Relational operators
 
Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vb
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in C
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
operators in c++
operators in c++operators in c++
operators in c++
 
Operators and Expression
Operators and ExpressionOperators and Expression
Operators and Expression
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++
 

Similar to 2 r algebra

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
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
Mukund Trivedi
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.ppt
Shylaja40
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
kavitha623544
 
cprogrammingoperator.ppt
cprogrammingoperator.pptcprogrammingoperator.ppt
cprogrammingoperator.ppt
georgejustymirobi1
 
Chapter 3.Simplex Method hand out last.pdf
Chapter 3.Simplex Method hand out last.pdfChapter 3.Simplex Method hand out last.pdf
Chapter 3.Simplex Method hand out last.pdf
Tsegay Berhe
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculator
Scilab
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
LavanyaManokaran
 
C Operators
C OperatorsC Operators
C Operators
Yash Modi
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
Visakh V
 
Intro to relational model
Intro to relational modelIntro to relational model
Intro to relational model
ATS SBGI MIRAJ
 
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
teach4uin
 
Relational operation final
Relational operation finalRelational operation final
Relational operation final
Student
 
3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra
ZakriyaMalik2
 
Chapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdfChapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdf
TamiratDejene1
 
L4_SQL.pdf
L4_SQL.pdfL4_SQL.pdf
L4_SQL.pdf
PriyanshTan
 
Relational Algebra.pptx for Module four
Relational Algebra.pptx for  Module fourRelational Algebra.pptx for  Module four
Relational Algebra.pptx for Module four
Monaliaghosh
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Raj vardhan
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
Kathirvel Ayyaswamy
 

Similar to 2 r algebra (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)
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.ppt
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
 
cprogrammingoperator.ppt
cprogrammingoperator.pptcprogrammingoperator.ppt
cprogrammingoperator.ppt
 
Chapter 3.Simplex Method hand out last.pdf
Chapter 3.Simplex Method hand out last.pdfChapter 3.Simplex Method hand out last.pdf
Chapter 3.Simplex Method hand out last.pdf
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculator
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
 
C Operators
C OperatorsC Operators
C Operators
 
Relational algebr
Relational algebrRelational algebr
Relational algebr
 
Intro to relational model
Intro to relational modelIntro to relational model
Intro to relational model
 
Cprogrammingoperator
CprogrammingoperatorCprogrammingoperator
Cprogrammingoperator
 
Relational operation final
Relational operation finalRelational operation final
Relational operation final
 
3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra3._Relational_Algebra.pptx:Basics of relation algebra
3._Relational_Algebra.pptx:Basics of relation algebra
 
Chapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdfChapter – 5 Relational Algebra.pdf
Chapter – 5 Relational Algebra.pdf
 
L4_SQL.pdf
L4_SQL.pdfL4_SQL.pdf
L4_SQL.pdf
 
Relational Algebra.pptx for Module four
Relational Algebra.pptx for  Module fourRelational Algebra.pptx for  Module four
Relational Algebra.pptx for Module four
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
 

More from Mr Patrick NIYISHAKA

Summary
SummarySummary
3 summary
3 summary3 summary
2 ddb architecture
2 ddb architecture2 ddb architecture
2 ddb architecture
Mr Patrick NIYISHAKA
 
1 ddb
1 ddb1 ddb
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
Mr Patrick NIYISHAKA
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
Mr Patrick NIYISHAKA
 
3 summary
3 summary3 summary
1 db security
1 db security1 db security
1 db security
Mr Patrick NIYISHAKA
 
4 summary
4 summary4 summary
3 summary
3 summary3 summary
2 con control
2 con control2 con control
2 con control
Mr Patrick NIYISHAKA
 
1 con exe
1 con exe1 con exe
1 basic concepts
1 basic concepts1 basic concepts
1 basic concepts
Mr Patrick NIYISHAKA
 
2 recovery
2 recovery2 recovery
3 transaction
3 transaction3 transaction
3 transaction
Mr Patrick NIYISHAKA
 
3 summary
3 summary3 summary
1 query processing
1 query processing1 query processing
1 query processing
Mr Patrick NIYISHAKA
 
1 query processing
1 query processing1 query processing
1 query processing
Mr Patrick NIYISHAKA
 
2 optimization
2 optimization2 optimization
2 optimization
Mr Patrick NIYISHAKA
 
2 collision
2 collision2 collision

More from Mr Patrick NIYISHAKA (20)

Summary
SummarySummary
Summary
 
3 summary
3 summary3 summary
3 summary
 
2 ddb architecture
2 ddb architecture2 ddb architecture
2 ddb architecture
 
1 ddb
1 ddb1 ddb
1 ddb
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
3 summary
3 summary3 summary
3 summary
 
1 db security
1 db security1 db security
1 db security
 
4 summary
4 summary4 summary
4 summary
 
3 summary
3 summary3 summary
3 summary
 
2 con control
2 con control2 con control
2 con control
 
1 con exe
1 con exe1 con exe
1 con exe
 
1 basic concepts
1 basic concepts1 basic concepts
1 basic concepts
 
2 recovery
2 recovery2 recovery
2 recovery
 
3 transaction
3 transaction3 transaction
3 transaction
 
3 summary
3 summary3 summary
3 summary
 
1 query processing
1 query processing1 query processing
1 query processing
 
1 query processing
1 query processing1 query processing
1 query processing
 
2 optimization
2 optimization2 optimization
2 optimization
 
2 collision
2 collision2 collision
2 collision
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 

2 r algebra

  • 1. 2. Relational Algebra Definition: The basic set of operations for the relational model. And a user enable to specify basic retrieval requests. ☞ The algebra operations produce new relations, which can be further manipulated using operations of the same algebra. ☞ A sequence forms a relational algebra expression ☞ Has a procedural paradigm: you need to tell what/how to construct the result
  • 2. 2. Relational Algebra Basic Relational Operation: ◆ Unary operations Select: σ. Project: or π. The rename operator: ρ. ◆ Binary operations Set operations: Union: Intersection: Difference: – Cartesian product Join operations:
  • 3. 2. Relational Algebra ◆ Unary operations Select Operation: Used to select a subset of the tuples from a relation that satisfy a selection condition. It is a filter that keeps only those tuples that satisfy a qualifying condition. Example To select the employee tuples whose department number is four or those whose salary is greater than $30,000 the following notation is used: Σdno = 4 (employee) Σsalary > 30,000 (employee) In general, the select operation is denoted by σ <selection condition>(r) where the symbol σ (sigma) is used to denote the select operator, and the selection condition is a boolean expression specified on the attributes of relation r.
  • 4. 2. Relational Algebra Rename Operation: To apply several relational algebra operations one after the other. Relational algebra expression by nesting the operations, or apply one operation at a time and create intermediate result relations. In the latter case, we must give names to the relations that hold the intermediate results. Example To retrieve the first name, last name, and salary of all employees who work in department number 5, we must apply a select and a project operation. We can write a single relational algebra expression as follows: Πfname, lname, salary(σ dno=5(employee)) Or explicitly show the sequence of operations, giving a name to each Intermediate relation: Dep5_emps ← σ dno=5(employee) Result ← π fname, lname, salary (dep5_emps)
  • 5. 2. Relational Algebra ◆ Binary Relational Operations ▪ Relational Algebra Operations from Set theory Union Operation: Denoted by r s, is a relation that includes all tuples that are either in r or in s or in both r and s. Example To retrieve the social security numbers of all employees who either work in department 5 or directly supervise an employee who works in department 5, we can use the union operation as follows: Dep5_emps ← σdno=5 (employee) Result1 ← π ssn(dep5_emps) Result2(ssn) ← π superssn(dep5_emps) Result ← result1 result2 The union operation produces the tuples that are in either result1 or result2 or both. The two operands must be “type compatible”.
  • 7. 2. Relational Algebra Join Operation: • The sequence of Cartesian product followed by select is used quite commonly to identify and select related tuples from two relations, a special operation, called join. It is denoted by a . • This operation is very important for any relational database with more than a single relation, because it allows us to process relationships among relations. • The general form of a join operation on two relations r(a1, a2, . . ., an) and s(b1, b2, . . ., bm) is: R <join condition>s Where r and s can be any relations that result from general relational algebra expressions.
  • 8. 2. Relational Algebra Join Operation: Example: Suppose that we want to retrieve the name of the manager of each department. To get the manager’s name, we need to combine each department tuple with the employee tuple whose ssn value matches the mgrssn value in the department tuple. We do this by using the join Dept_mgr ← department operation. mgrssn=ssn(mployee).