What is an RDBMS, and what does the relational part actually guarantee that a plain file store does not?
An RDBMS is a program that stores data in tables and lets you ask questions about it in SQL, and the word "relational" is the part that carries the meaning.
It does not mean that the tables are related to each other. It means something more specific. Every row in a table has the same set of columns, and every column has the same meaning in every row. That sounds obvious, but it is exactly what a plain file of records does not give you.
What does the relational part actually guarantee? Four things that a plain file store does not.
The first one is that a value is stored in one place. The name of a customer is in the customer table, and the orders table holds a reference to that customer rather than a copy of the name. So when the name changes, there is one row to change.
The second one is that the rules are kept for you. The engine can say that this column must be different for every row, that this column must point at a row that really exists, and that this column must have a value.
The third one is that the answer can come from more than one table. You can ask for the orders and the customer names together, and the engine works out how to join them.
The fourth one is that the answer is the same every time. Two queries that ask the same question give the same answer, because the engine has decided the order and the engine keeps it.
CREATE TABLE account_balances (
account_id INTEGER PRIMARY KEY,
owner TEXT NOT NULL,
balance_cents INTEGER NOT NULL,
CONSTRAINT balance_not_negative CHECK (balance_cents >= 0)
);
CREATE TABLE accounts (
id INTEGER PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
balance_cents INTEGER NOT NULL,
FOREIGN KEY (id) REFERENCES account_balances (account_id)
);
The next question in this topic looks at the four letters that people use to describe what a relational database gives you.