Definition: A relational database stores data in tables made of rows and columns, where each table represents a type of thing, such as users, products, or orders.
The tables can be connected to each other through relationships, usually using primary keys and foreign keys, and SQL is commonly used to work with the data.

Simple example

Imagine an online shop:

Users table

idname
1Alice
2Bob

Orders table

iduser_idproduct
1011Laptop
1021Mouse
1032Keyboard

Here:

  • Users.idPrimary Key: uniquely identifies each user.

  • Orders.user_idForeign Key: points to a user.

  • Because Orders.user_id = Users.id, we know which user made which order. (Microsoft Learn)

Why is it called “relational”?

Because the important idea is that data in different tables has relationships.

Users

  │ user_id

Orders

  │ product_id

Products

So instead of putting everything into one giant table, you separate related information into logical tables and connect them.

3 examples

  1. Banking: CustomersAccountsTransactions

  2. University: StudentsCoursesEnrollments

  3. E-commerce: UsersOrdersProducts

Common relational databases include PostgreSQL, MySQL, Microsoft SQL Server, and Oracle Database.

In one sentence:

A relational database is basically organized tables + relationships between those tables.


Database My-Journey-In-Codeless