What Does 'Relational' Mean?


I would guess that many people think that "relational" in "relational database" has to do with relationships between entities expressed via foreign keys.

I confess that's what I thought until I started reading Chris Date.

In fact, the term "relational" is a reference to the mathematical concept of a relation that I've touched on as part of the Poincare Project.

This fact was obscured to me somewhat by the fact that I've typically only dealt with binary relations but relations can be n-ary.

A relation is really just a subset of a cartesian product.

Consider the set of Employees at a company and the set of Departments. Which employees work at which departments can be expressed as a set of ordered pairs, a subset of the cartesian product Employees x Departments. In mathematical terms, this is a relation.

If we wanted to express, say, extension number as well, we could take as our relation a subset of the cartesian product Employees x Departments x Extensions. This relation is just a set of tuples.

This is the sense in which "relational" is used in "relational database".

In SQL, tables almost correspond to relations and rows to tuples. I say almost because SQL violates the relational model in allowing duplicate rows.