Eroxl's Notes
Relation

A relation is the mathematical construct that underlies the concept of a table in relational database theory. They provide the theoretical foundation for the relational model.

Formal Definition

A relation schema consists of a relation name and a list of attributes .

Each attribute has an associated domain .

A relation instance (or simply a relation) is a set of tuples:

The degree (or arity) of a relation is the number of attributes . The cardinality of a relation is the number of tuples .

Properties

Because a relation is defined as a set, the following properties hold:

  1. No duplicate tuples: Every tuple in the relation is distinct.
  2. Tuple ordering is irrelevant: The set has no inherent ordering among its tuples.
  3. Attribute ordering is irrelevant: Attributes are identified by name, not position (though a positional notation is sometimes used formally).
  4. Attribute values are atomic: Each value is drawn from the associated domain and is indivisible (this corresponds to 1NF).

Relation Vs Table

In informal usage, a relation is called a table, a tuple is called a row, and an attribute is called a column. Strictly, a table may permit duplicate rows and ordered columns, while a relation does not.

Formal Term Informal Equivalent
Relation Table
Tuple Record
Attribute Field
Domain Data Type

Operations

Relations are manipulated through relational algebra, which defines a set of closed operations (each operation takes one or more relations as input and produces a relation as output).