Why Relational Databases Are Called “Relational” (It’s Not About Relationships!)
Sajith Dilshan
Senior Software Quality Assurance Engineer | ISTQB? CT-FL | QAOps | Content Creator | Tech Enthusiast
As a software engineer, you’ve probably worked with relational databases—tools like MySQL, PostgreSQL, or Oracle. And chances are, at some point, you’ve been told they’re called “relational” because they allow you to create relationships between tables using foreign keys.
That explanation seems logical, right? After all, foreign keys are one of the defining features of how we use these databases. But here’s the kicker: it’s wrong.
The word “relational” in relational databases has nothing to do with relationships between tables. It’s about something far deeper—something rooted in the world of mathematics. So, let’s break it down like experienced engineers chatting about database fundamentals.
The Math Behind "Relational"
Back in 1970, Edgar F. Codd, a computer scientist working at IBM, introduced the concept of relational databases in his groundbreaking paper, "A Relational Model of Data for Large Shared Data Banks."
Codd didn’t come up with the term “relational” because tables relate to each other. Instead, he was inspired by relational algebra, a branch of mathematics. In relational algebra, a relation is a mathematical concept—a structured way of organizing data.
To put it simply, a relation is a set of tuples that share the same attributes.
What Is a Relation in Plain Terms?
Let’s map this to something we deal with every day: tables in a database.
For example, imagine a table of employees:
Here:
What Makes a Database Relational?
A relational database is one where all data is stored in relations (tables) that conform to strict principles. Whether or not there are relationships between tables doesn’t matter—it’s all about organizing data in a structured, logical way.
领英推荐
Core Principles of Relational Databases:
Where Relationships Come Into Play
So, where does the confusion come from? Well, foreign keys and relationships between tables are a very visible feature of relational databases.
For example, you might have an Employees table and a Departments table, with a foreign key linking EmployeeID to a department:
you’ve created a relationship between Employees and Departments.
While this feature is incredibly useful, it’s just one aspect of relational databases—it’s not what makes them relational. Even if you had a single table with no foreign keys, the database would still be relational as long as it adheres to the relational model.
Why This Matters to You
So, why should you, as a software engineer, care about this distinction?
Final Thoughts
Relational databases are called “relational” because they’re based on relations in relational algebra, not because of the relationships between tables. It’s a subtle but important distinction.
As engineers, it’s easy to get caught up in the features of a technology and lose sight of its theoretical underpinnings. By digging into the "why" behind relational databases, we can better understand their strengths, limitations, and how to use them effectively in our systems.
So next time someone says relational databases are about relationships, you’ll know better—and maybe even enjoy setting the record straight.
References: