1. Subject Name Code Credit Hours
Database System COMP 219 3
Chapter VIII
2. Subject Name Code Credit Hours
Database System COMP 219 3
Relational Algebra
• It consistes of a set of operations
• Select
• Project
• Union
• Set difference
• Intersection
• Cartesian Product
• Join
• Division
• Rename
3. Subject Name Code Credit Hours
Database System COMP 219 3
Select
• It selects tuples that satisfy a given
predicate, To denote selection
(Sigma) is used.
Syntax: cond
(Table name)
4. Subject Name Code Credit Hours
Database System COMP 219 3
Select
• E.g..
Sal>1000 (Employee)
Selects tuples whose emp sal is > 1000
5. Subject Name Code Credit Hours
Database System COMP 219 3
Project
• It selects attributes from the relation.
• II – Symbol for project
Syntax: ll <Attribute
list>
(table name)
E.g…
Eid,sal (employee)ll
Selects all
tuples from
emp relation
& only eid &
sal attributes
are projected
6. Subject Name Code Credit Hours
Database System COMP 219 3
Join
• Natural Join (or) Equi Join
• Outer Join
Natural Join (or) Equi Join
- Used to combine related tuples from two relations.
- It requires that the two join attributes have the same name.
- Symbol:
7. Subject Name Code Credit Hours
Database System COMP 219 3
Join
• Syntax:
8. Subject Name Code Credit Hours
Database System COMP 219 3
Select Operation:
• It selects tupules that satisfy a given predicate.
• To denote selection -
9. Subject Name Code Credit Hours
Database System COMP 219 3
END OF Chap VIII
References:
• Database system concepts
Siberschatz, korth and sudharsan