Relational Algebra Knowledge
Kip Landergren
(Updated: )
My Relational Algebra knowledge base explaining an overview, the core idea, and listing key concepts.
Contents
Overview
Relational Algebra is the mathematics behind manipulating and operating on specially structured tables of related data called, appropriately, relations. Operators in relational algebra take relations as input and return relations as output. This allows composability and expressitivity.
A relation is a set of tabular data comprised of:
- attributes, or columns, which represent the divisions of data kinds
- tuples, or rows, of data across attributes; also known as a record
Operators include:
- selection, where a formula for filtering a relation is specified
- projection, where a new relation restricted to a specfiic set of attributes is produced
- cross product, where two relations are combined to form another
- rename, where a set of attributes of a relation may be renamed
- natural join, representing all tuple combinations where there is a common attribute name
- theta join, representing a join with a condition
- set union
- set difference
Note: “selection” is not the same as SQL select
statement.
Core Idea
Define an algebra to operate on relations—groups of related data in tabular form—that takes relations as input and returns relations as output .
Key Concepts
- set theory
- logic theory
- algebra