CSE Roadmap

Core tier · about 2 hours · 5 parts

Part 3 of 5 · 2 min read

Why it's called "relational"

The mathematical meaning of "relation", distinct from the everyday word "relationship".

Think of a relation in the mathematical sense. It is a set of tuples. Each tuple holds one value from each of several fixed domains. No tuple needs to connect to any other tuple.

In plain words: a table is, mathematically, a relation. It is a set of rows, called tuples. Each row holds one value per column, drawn from that column's domain of allowed values. The word "relational" refers to this mathematical relation. It does not refer to foreign-key relationships between tables, which is the meaning most people guess first. A table with no foreign keys at all is still, by itself, a relation.

A worked example. customers is a relation over three domains. One domain is whole numbers, for customer_id. Two domains are text, for full_name and address. Each of its 400 rows is one tuple drawn from those three domains. Calling it a relation needs nothing from any other table.

The key lines. There is no new SQL here. This part is about the vocabulary behind the SQL already shown.

Relation, tuple, attribute

A relation is a set of tuples. A tuple is one ordered combination of values, one per attribute. An attribute is a named column, together with the domain of values it may hold. Table, row and column are the everyday names for exactly these three ideas.

Example: the customers relation has the attributes customer_id, full_name and address. (107, "Asha Rao", "14 MG Road, Pune") is one tuple belonging to it.

For the curious Where the name actually comes from

The term comes from a 1970 proposal to store data as mathematical relations. That replaced the nested, pointer-linked records common before it. Level 3 covers how a design is judged good or bad under this model. This page only needs the vocabulary.