Relational Foundations

Relations, Tuples, Attributes, and Domains

A relation has a heading of named, typed attributes and a body containing tuples that conform to that heading. Domains constrain the values an attribute may take, while tuples associate one value with every attribute by name.
  • A relation schema declares a heading; a relation instance supplies its current body.
  • A tuple is a mapping from attribute names to values, not merely a left-to-right list.
  • A domain is the declared set or type from which an attribute draws values.
  • Degree is the number of attributes in the heading; cardinality is the number of tuples in the body.
  • Attribute and tuple order are presentation choices rather than properties of a relation.
  • Each attribute value is a value of its declared domain; whether a value is “atomic” depends on the operations recognized by the type system, not on how it is printed.

The parts of a relation

Relation structure and conformance
The heading defines names and domains; every tuple in the body conforms to it.
One relation instance: degree 3, cardinality 3
student_idcourse_idterm
42DB1012026-S1
42ALG2002026-S1
77DB1012026-S1

Reordering the displayed columns to (term, course_id, student_id) or sorting the three tuples differently does not create a different relation. Renaming course_id does change the heading and therefore requires an explicit rename operation so later expressions still refer to attributes unambiguously.