Relational Model
The relational model, introduced by Edgar Codd in 1970, is the theoretical foundation for relational DBMS. It represents data as relations (tables), where each relation is a set of tuples (rows) with attributes (columns). All data manipulation is performed through Relational Algebra operations.
Core Terminology
| Formal Term | Common Term | Description |
|---|---|---|
| Relation | Table | A set of tuples with a defined schema |
| Tuple | Row / Record | A single data entry in a relation |
| Attribute | Column / Field | A named property with a domain (type) |
| Domain | Data type | The set of allowed values for an attribute |
| Schema | Table definition | The structure (attribute names and domains) |
| Degree | Column count | Number of attributes in a relation |
| Cardinality | Row count | Number of tuples in a relation |
Integrity Rules
Entity Integrity
Every relation must have a Primary Key, and no primary key attribute can be NULL.
Referential Integrity
Every Foreign Key value must match an existing Primary Key value in the referenced relation, or be NULL.
Domain Integrity
All attribute values must come from the attribute’s defined domain (enforced via SQL Data Types and CHECK constraints).
Properties of Relations
- No duplicate tuples — Guaranteed by the Primary Key
- Tuples are unordered — There is no inherent row order (ORDER BY is a query operation)
- Attributes are unordered — Column order doesn’t matter
- Attribute values are atomic — Each cell contains a single value (1NF)
Schema vs Instance
- Schema — The structure definition (table name, column names, types, constraints). Rarely changes.
- Instance — The current set of data (rows) in the table. Changes with every INSERT/UPDATE/DELETE.
From Conceptual to Relational
The Entity-Relationship Diagram (ERD) captures the conceptual model, which is then mapped to the relational model through Normalization:
- Entities → Tables
- Attributes → Columns
- Relationships → Foreign keys and junction tables
- Constraints → PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK