Skip to content
Contents/CH 08
Relational Model/Beginner · 14 min

Relational Model: Domains, Tuples & Cardinality

The relational model is deceptively simple: data lives in tables, and queries describe the result instead of the navigation path.

In plain English

A table is a sheet of graph paper: columns are labels and rows are records.

The one idea

A relation is a set of tuples over named, typed domains; row order and duplicate tuples are not part of the model.

Set semantics are what let the optimizer reorder joins, push filters, and return the same answer by a different plan.

By the end

  1. 01Define relation, tuple, attribute, domain, degree, and cardinality.
  2. 02Distinguish a schema from an instance.
  3. 03Explain why the relational model is declarative.
  4. 04Read a relation as a set of tuples.
01

Relations, tuples, and attributes

A relation is a table with a fixed set of columns. A tuple is a row. An attribute is a named column. A domain is the set of allowed values for an attribute, such as integers or dates. The degree is the number of attributes; the cardinality is the number of tuples. A relation is a set, so duplicate rows are not allowed in the pure model.

chapter-08.db
Student(id, name, age)

degree = 3
cardinality = 4

{ (1, Ada, 21),
  (2, Grace, 22),
  (3, Linus, 20),
  (4, Margaret, 23) }
02

Schema versus instance

The schema is the structure: relation names, attributes, domains, and constraints. The instance is the data at a particular moment. The schema changes rarely; the instance changes constantly. A database catalog stores the schema and metadata.

03

Declarative access

In the relational model, you describe the result you want, not the pointer path to it. The DBMS chooses an execution plan using indexes, statistics, and join algorithms. This logical independence is why relational systems became the default for general-purpose data.

Worked example3 steps

Enrollment is a set

A relation Enrollment has student_id, course_id, and grade. Two identical rows would mean the same student took the same course with the same grade twice.

01

Insert (1, C1, A) twice.

A true relation keeps one tuple; SQL may keep both unless a key forbids it.

02

Project only course_id.

Duplicate course values collapse in relational algebra; SQL needs DISTINCT.

03

Join Enrollment with Student on student_id.

The result is a new relation with a combined schema.

ConclusionThe relational model is small: domains, tuples, relations, and operations. Its power comes from closing every operation over relations.

The trade-off

No free correctness.

Gain

Declarative queries, set-based optimization, and a simple logical model.

Cost

Joins can be expensive, and real SQL systems reintroduce duplicates and nulls.

Verdict

The default model for business data because it separates meaning from navigation.

Recap

What to keep.

Takeaways

  • +A relation is a table; a tuple is a row; an attribute is a column.
  • +A domain defines the allowed values of an attribute.
  • +Degree counts attributes; cardinality counts tuples.
  • +The schema is structure; the instance is current data.
  • +Relational queries are declarative.

Traps

  • !Confusing degree with cardinality.
  • !Assuming a table must have a primary key in the pure model; keys are constraints.
  • !Forgetting that a relation is a set, not a bag.

Focus

  • →Compute degree and cardinality from a small table.
  • →Give an example of a domain.
  • →Explain declarative versus navigational access.

Check yourself

Before you turn the page.

0 / 2 answered
01

What is the degree of a relation?

02

What is the cardinality of a relation?

DB//COSMOS

A field manual for database systems: model the domain, normalize the facts, query the relations, and protect the result.

Edition 2026 · 32 chaptersTopic catalogInterview prep