Relational Database
- In Turkish
- İlişkisel Veritabanı
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
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
- SQLDatabases, p. 40SQL is the standard language for working with relational databases, used to create tables and to insert, query, update, and delete the data stored in them.
- Primary KeyDatabases, p. 36A primary key is a column, or set of columns, whose value uniquely identifies each row in a database table and can never be empty or duplicated.
- Foreign KeyDatabases, p. 21A foreign key is a column in one database table that refers to the primary key of another table, linking related rows and keeping those references valid.
- SQL JOINDatabases, p. 41A SQL JOIN is a query operation that combines rows from two or more tables into one result, matching them on related columns such as a foreign key.
- Database NormalizationDatabases, p. 9Database normalization is the process of organizing tables so each fact is stored only once, reducing duplicate data and preventing inconsistent updates.
- Document DatabaseDatabases, p. 15A document database is a NoSQL database that stores each record as a self-contained document, usually JSON-like, whose fields can differ from record to record.
- PostgreSQLDatabases, p. 35PostgreSQL is a free, open-source relational database known for reliability, strict standards support and extensions, and widely used for web applications.
- MySQLDatabases, p. 27MySQL is a popular open-source relational database queried with SQL, long known as the database behind WordPress and the classic LAMP web stack.
- SQL ServerDatabases, p. 42Microsoft SQL Server is Microsoft's relational database, queried with the T-SQL dialect of SQL and widely used for business apps alongside .NET and Windows.
Spotted a mistake or something missing on this page?Suggest an edit