Introduction
Relational Algebra is a procedural
language used for manipulating relations. The relational model gives the
structure for relations so that data can be stored in that format but
relational algebra enables us to retrieve information from relations. Some advanced
SQL queries requires explicit relational algebra operations, most commonly outer
join.
Relations are seen as sets of
tuples, which means that no duplicates are allowed. SQL behaves differently in
some cases. Remember the SQL keyword distinct. SQL is declarative, which means
that you tell the DBMS what you want.
Set operations
Relations in relational algebra
are seen as sets of tuples, so we can use basic set operations.
Review of
concepts and operations from set theory
_ Set
_ Element
_ No duplicate elements
_ No order among the elements
_ Subset
_ Proper subset (with fewer
elements)
_ Superset
_ Union
_ Intersection
_ Set Difference
_ Cartesian product
0 comments