beginnerdbms

The Relational Model

Data lives in tables. Tables connect through keys. That's the whole idea.

Key Points

What it is

The relational model organizes data into tables, where each table has rows (records) and columns (attributes). Tables relate to each other through shared keys. It's the foundation of every SQL database you'll ever use.

Why it exists

Before relational databases, data was stored in hierarchical or network structures that were rigid and hard to query. The relational model gave us a clean, flexible way to store data once and query it in any direction without restructuring the whole thing.

Intuition

Think of a school. Students are in one table. Courses are in another. If you stored every course a student takes inside the student row itself, you'd repeat course details for every student and updating a course name would mean changing hundreds of rows. Instead, you keep students and courses separate, and use an enrollment table in the middle that just says 'student 42 is enrolled in course 7'. Now you can change a course name once and it reflects everywhere.

When to use

Common mistakes

Notes

In practice

Every time you pull data from a SQL database for analysis, you're working with the relational model. Understanding keys and relationships is what lets you write correct JOIN queries without accidentally duplicating or losing rows.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

sql-basicsnormalizationjoins
Chirp at me!