Skip to main content

Relational Database

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/relational-database

In short

A relational database stores data in tables of rows and columns, links those tables through keys, and lets you query and combine the data with SQL.

What is a relational database?

A relational database organizes data into tables, where each column has a name and a data type and each row holds one record, such as one customer or one order. Every row is identified by a primary key, and tables point to each other with foreign keys. The idea comes from the relational model that Edgar F. Codd published at IBM in 1970, and it is still the most widely used way to store business data.

A schema defines the tables, column types, and constraints such as NOT NULL or UNIQUE, and the database rejects data that breaks those rules. You read and change data with SQL, and a component called the query planner decides how to run each query, for example whether to use an index. Related data is kept in separate tables and combined at read time with joins, while transactions with ACID guarantees keep multi-step changes safe. Well-known relational databases include PostgreSQL, MySQL, SQLite, SQL Server, and Oracle Database.

A relational database is like a set of linked spreadsheets with strict rules: each sheet allows only certain kinds of values in each column, and a customer ID on the orders sheet always matches a real row on the customers sheet. That structure makes it a strong default for banking, e-commerce, inventory, bookings, and user accounts, where data has clear relationships and must stay correct.

Relational databases are often confused with SQL itself or contrasted too sharply with document databases. SQL is the language; the relational database is the system that stores the tables. A document database keeps related data together in one nested document instead of splitting it across tables and joining it later. The word relational refers to the tables themselves, which Codd called relations, rather than to the relationships between tables.

Key takeaways

  • Data lives in tables with typed columns and one row per record.
  • Primary keys identify rows, and foreign keys link rows across tables.
  • SQL is used to query the data, and joins combine tables at read time.
  • A schema and constraints reject invalid data before it is stored.
  • Transactions with ACID guarantees keep multi-step changes consistent.

Example

Two related tables and a joinsql
CREATE TABLE customers (
  id   INTEGER PRIMARY KEY,
  name TEXT NOT NULL
);

CREATE TABLE orders (
  id          INTEGER PRIMARY KEY,
  customer_id INTEGER NOT NULL REFERENCES customers (id),
  total       NUMERIC(10, 2) NOT NULL
);

-- Combine the two tables through the key that links them
SELECT c.name, o.total
FROM orders AS o
JOIN customers AS c ON c.id = o.customer_id;

Readers ask

What is an RDBMS?

RDBMS stands for relational database management system, the software that stores and manages relational data. PostgreSQL, MySQL, and SQLite are examples, and in everyday speech RDBMS and relational database are used interchangeably.

Why is it called a relational database?

In the relational model, a table is called a relation: a set of rows that share the same columns. The name comes from that mathematical term, not from the links between tables.

When is a relational database not the best choice?

It can be a poor fit for data with no fixed shape, for extremely high write volumes spread across many servers, or for queries that follow long chains of relationships. Document, key-value, time-series, and graph databases target those cases.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings