What is a Relational Database?
In this lesson: Relational database explained — tables, rows, columns, keys and relations — with simple student/course examples.
What is a relational database
A relational database stores data in tables and links those tables together using keys. It follows the relational model, is managed with SQL, and is by far the most popular kind of database. MySQL, PostgreSQL and Oracle are all relational databases.
Everything is a table
In a relational database, all data lives in tables of rows and columns:
| id | name | city |
|---|---|---|
| 1 | Aman | Delhi |
| 2 | Diya | Mumbai |
Columns define the fields; each row is one record. This simple, uniform structure is easy to understand and query.
Relationships via keys
Tables connect using keys. A foreign key in one table points to the primary key of another:
customers(id PK, name) orders(id PK, customer_id FK -> customers.id, amount)
This lets you store customer details once and link many orders to them — no duplication, and the data stays consistent.
SQL is the language
SELECT name, city FROM customers WHERE city = 'Delhi';
Relational databases are managed with SQL (Structured Query Language). You use it to create tables, add and change data, and run queries. Because SQL is a standard, your skills carry across different relational databases.
Reliable with ACID
Relational databases support ACID transactions — Atomicity, Consistency, Isolation, Durability. This means a group of changes either fully succeeds or fully fails, and committed data is never lost. It is what makes them trustworthy for banking, orders and other critical data.
Why it is popular
- Simple model — tables are easy to understand.
- Powerful queries — SQL can join, filter and summarise data easily.
- Data integrity — keys and constraints keep data correct.
- Reliability — ACID transactions protect important data.
These strengths make relational databases the default choice for most applications.
Common mistakes
- Confusing relational and non-relational. Relational uses fixed tables and SQL; NoSQL is more flexible.
- Repeating data instead of using keys. Link tables with foreign keys.
- Mixing up MySQL and SQL. MySQL is the database; SQL is the language.
- Ignoring ACID. It is why transactions are safe.
Summary
- A relational database stores data in tables linked by keys.
- It follows the relational model and is managed with SQL.
- Foreign keys connect tables and avoid duplication.
- ACID transactions make it reliable for critical data.
- Its simplicity and power make it the most popular database type.
Next, learn the table model in RDBMS concepts, or the wider picture in the DBMS tutorial.
