100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
SQL

The Relational Model

Understand how the relational model organizes data into tables of rows and columns, based on set theory and predicate logic.

Introduction to DatabasesBeginner9 min readJul 8, 2026
Analogies

Introduction

The relational model, introduced by Edgar F. Codd in 1970, is the foundational theory behind most databases in use today. Instead of organizing data as nested records or free-form documents, the relational model represents all data as relations — which, in practice, are simply tables made up of rows and columns.

🏏

Cricket analogy: Just as Sunil Gavaskar helped establish modern batting technique in the 1970s, Edgar Codd in 1970 established the relational model, replacing messy nested scorecards with clean tables of rows (innings) and columns (runs, balls, fours).

This simple, uniform structure turned out to be extremely powerful: it lets you describe complex relationships between different kinds of data (customers, orders, products) using a small, consistent set of concepts, and it lets you query that data using declarative languages like SQL instead of writing custom retrieval code.

🏏

Cricket analogy: The same simple table structure can describe batsmen, matches, and venues together, and instead of writing custom code to find "all centuries at Lord's," you simply declare the question in SQL and let the engine fetch it.

Key Concepts

In relational terminology: a 'relation' is a table, a 'tuple' is a row (a single record), and an 'attribute' is a column (a named field with a specific data type). Every table has a schema that defines its columns and their types. Rows in one table can reference rows in another table through keys, which is how the relational model represents relationships without duplicating data.

🏏

Cricket analogy: A "relation" is the scorecard table, a "tuple" is one batsman's row, and an "attribute" is a column like runs or strike rate; the schema fixes those column types, and each innings row links to the match table by match_id instead of repeating the venue name.

A 'relation' in the mathematical sense (from set theory) is what we casually call a table. The word 'relational' refers to this formal structure, not directly to 'relationships between tables' — though relationships between tables are also a central feature of relational databases.

Example

sql
-- Two related tables: customers and orders
CREATE TABLE customers (
    customer_id SERIAL PRIMARY KEY,
    full_name   VARCHAR(100) NOT NULL
);

CREATE TABLE orders (
    order_id    SERIAL PRIMARY KEY,
    customer_id INTEGER REFERENCES customers(customer_id),
    order_total NUMERIC(10, 2) NOT NULL,
    order_date  DATE DEFAULT CURRENT_DATE
);

-- Query that combines data across both relations
SELECT c.full_name, o.order_total, o.order_date
FROM customers c
JOIN orders o ON o.customer_id = c.customer_id;

Analysis

Here, customers and orders are two separate relations. The orders.customer_id column is a foreign key that references customers.customer_id, linking each order tuple to exactly one customer tuple without storing the customer's name redundantly inside the orders table. The JOIN in the query reconstructs the connection at query time. This separation — store data once, link it by key, combine it when needed — is the essence of the relational model and is what allows data to stay consistent as it grows.

🏏

Cricket analogy: Players and matches are separate relations; the innings.player_id foreign key references players.player_id, so a century isn't stored with the player's full bio -- the JOIN reconstructs the link only when the scorecard report is generated.

Key Takeaways

  • The relational model represents all data as relations (tables) of tuples (rows) and attributes (columns).
  • Relationships between tables are expressed through keys, not by duplicating data.
  • Data is stored once and combined at query time using operations like JOIN.
  • The relational model is declarative: you describe what data you want, not how to fetch it step by step.

Practice what you learned

Was this page helpful?

Topics covered

#SQL#DatabaseSQLStudyNotes#Database#TheRelationalModel#Relational#Model#Key#Concepts#StudyNotes#SkillVeris