Beruflich Dokumente
Kultur Dokumente
Relational Algebra
Consider the relation "Book" List the number, surname and age where there are
either graduates or managers.
AccountNu Yr_pub Title
m
4.4.2. Difference Operation
734216 2002 Algorithm Design
237235 2005 Database Systems Finds tuples in one relation but not in
631523 2002 Compiler Design
other. Meaning, tuples that are in R, but
543211 2011 Programming
376112 2008 Machine Language not in S.
Must be union-compatible
Example1: Select from the relation “Book” all the
books whose year of publication is 2002.
Example: Given the relation Graduates & Managers,
Example2: Select from the relation “Book” all the books determine the difference of
whose Acc-no is greater than equal Graduates & Managers
to 56782.
R
GRADUATES X Y
Number Surname Age a 1
7274 Robinson 37 b 2
7432 O’Malley 39 a 2
9824 Darkes 38 R x S
R.X R.Y S.Y S.Z
MANAGERS
a 1 3 1a
Number Surname Age a 1 2 2b
9297 O’Malley 56 b 2 3 1a
7432 O’Malley 39 b 2 2 2b
9824 Darkes 38 a 2 3 1a
a 2 2 2b
4.4.4. Cartesian Product 1. Left Outer Join : all rows from the
table on the left are included,
Allows combining information from two
regardless of whether they match
relations.
rows from the table on the right.
Defines relation that is the concatenation
of every tuple of relation R with every tuple
of relation S. 2. Right Outer Join : all rows from the
Multiplies two relation to define another table on the right are included,