Why relational databases still run the world. What relational means, why a spreadsheet stops working, and what a database does instead: each fact stored once, rules that keep it honest, and a question you ask with SQL.
Your bank balance, your contacts and your lunch order all live in a database, and nearly always the same kind, called relational. This video shows what that word means and why the design still runs the world.
It starts with a spreadsheet, the nearest thing most of us have used, and the day it outgrows what it was built for: the same customer typed three ways, a change easily overwritten, an afternoon of scrolling to answer one question. A relational database splits the sheet into tables, gives every row a key and stores each fact once, so a customer who moves house changes one row, not forty. Each table is a relation, one kind of fact in one fixed shape, and the keys are how the tables refer to each other. You don’t scroll through it, you ask it, with SQL, and every question has the same three parts. Rules keep it honest, down to the bank transfer that either happens in full or not at all.
That is why, more than fifty years on, it still runs the bank, the shop and the booking system.
The facts are in the video’s sources: Codd’s 1970 paper, the SQL standard, and the limits of a spreadsheet as its maker documents them. This is an independent explainer, not affiliated with any vendor.
Transcript
Your bank balance, your contacts and your lunch order all live in a database, and nearly always the same kind, called relational. Before it, each program kept its data however it needed, in its own lists and files.
The nearest thing most of us have used is a spreadsheet, one row per order and one column per detail. A spreadsheet works well, right up until it outgrows what it was built for.
The same customer gets typed three different ways, so nobody knows how many customers you have. Two people edit at once, and a change can easily be overwritten. Asking who ordered in March but not April means an afternoon of scrolling.
A database starts by splitting that one sheet into tables. Customers in one, orders in another. Every row gets its own number, called its key. The customer's name and address are stored once. Each order points at the customer's number instead.
That's why it's called relational. Each table is a relation, which is one kind of fact in one fixed shape. The keys are how the tables refer to each other.
Now say a customer moves house. They've placed forty orders with you. How many rows have to change?
Only one row changes, and it belongs to the customer. The address lives in one place, and every order refers to it by number. That's the first thing you get from a database. Each fact is stored once, so it can't disagree with itself.
The second thing is how you get answers. Instead of scrolling, you ask the database directly. The way you ask is called SQL, which stands for Structured Query Language. A query is just a request for information.
It's called structured because every question has the same three parts. You say what you want, where it lives, and which ones you need. The database does the searching and hands back the rows. Even with millions of rows, the answer comes back in under a second.
The third thing is rules. An order can't point at a customer who doesn't exist. Two people can't save over each other's changes. A change either happens in full or not at all. When a bank moves money between two accounts, it leaves one and lands in the other, or neither happens. It never stops halfway.
So a database isn't a bigger spreadsheet. A spreadsheet is a page you look at, and a database is something you ask.
Every fact is stored once, the answers come back instantly, and the numbers add up. That is why, more than fifty years on, it still runs the bank, the shop and the booking system.
A relational database is facts in tables that refer to each other. Each fact is stored once, and rules keep it honest. Ask with SQL, and you get a clear answer.
Found this useful?
Subscribe for the next one, or tell me what you want explained. I take requests.