5. Relational Algebra

At the basis of relational data bases is the relational algebra, an algebra on sets of tuples (“relations”) defining six operators:

  • unary select – select tuples matching to some condition
  • unary project – make a set of sub-tuples of all tuples (i.e., have less columns)
  • unary rename – change the name of a relation (this is a rather technical operation)
  • binary cartesian product – the usual cartesian product, except that the tuples are concatenated rather than just put into a pair; this, of course, is not usually actually computed but rather used as a formal step.
  • binary union – simple union of sets. This is only defined for “compatible” relations; the technical points don’t matter here
  • binary set difference as for union; you could have used intersection and complementing as well, but complementing is harder to specify in the context of relational algebra

Good News: You don’t need to know any of this. But it’s reassuring to know that there’s a solid theory behind all of this.


Markus Demleitner, Hendrik Heinl

Copyright Notice