Dbms Module 2 Part2
Dbms Module 2 Part2
CALCULUS
SELECT and PROJECT
Assistant
5 CSE
Professor
Assistant
5 CSE
Professor
Assistant
6 EE
Professor
Assistant
6 EE
Professor
πClass, Dept(Faculty)
Class Dept
5 CSE
6 EE
Sequences of Operations and the RENAME operation
Inline expression(single line expression)
OR
Assignment Operation
• We can also define a formal RENAME operation—which can
rename either the relation name or the attribute names,
or both—as a unary operator.
where the symbol ρ (rho) is used to denote the RENAME operator, S is the new
relation name, and B1, B2, … , Bn are the new attribute names.
Relational Algebra Operations
from Set Theory: The UNION, INTERSECTION, and MINUS
Operations
Student_detail
SID Name Std Class Subject
101 Alex 10 10 Math
101 Alex 10 10 English
102 Maria 11 11 Music
102 Maria 11 11 Sports
Natural Join
Courses HoD
CID Course Dept Dept Head
CS01 Database CS CS Alex
ME01 Mechanics ME ME Maya
EE01 Electronics EE EE Mira
Courses * HoD
Left Right
A B A B
100 Database 100 Alex
101 Mechanics 102 John
102 Electronics 104 Mira
A B C D
100 Database 100 Alex
101 Mechanics --- ---
102 Electronics 102 John
Right Outer Join: ( R S )
Left Right
A B A B
100 Database 100 Alex
101 Mechanics 102 John
102 Electronics 104 Mira
A B C D
Left Right
A B A B
100 Database 100 Alex
101 Mechanics 102 John
102 Electronics 104 Mira
A B C D
100 Database 100 Alex
101 Mechanics --- ---
102 Electronics 102 John
--- --- 104 Mira
The JOIN(Equijoin) operation, denoted by , is used to combine related tuples
from two relations into single “longer” tuples.