03.chapter 2 Update
03.chapter 2 Update
Model of Data
Relation Schema
Relational Algebra
An algebra consists of operators and atomic
operands
Relational algebra is an example of an algebra,
its atomic operands are
Variables that stand for relations
Constants, which are finite relations
Relational algebra is a set of operations on
relations
Operations operate on one or more relations to
create new relation
THE RELATIONAL MODEL OF DATA 27
2.3 An Algebraic Query Language
Relational algebra fall into four classes
Set operations – union, intersection, difference
Selection and projection
Cartesian product and joins
Rename
Relation R
Relation S
σlength100(Movies)
title year length genre
Gone With the Wind 1939 231 Drama
Star Wars 1977 124 Scifi
title,year,length(Movies) genre(Movies)
title year length genre
Star Wars 1977 124 Scifi
Galaxy Quest 1999 104 Comedy
Wayne’s World 1992 95
Cartesian product R3 := R1 Χ R2
title,year
length>=100 studioName=‘Fox’
Movies Movies