Database Discussion/

Relational Database

Lesson overview

Relational Database

Relational databases: structure, use cases, and trade-offs.

A relational database stores data in tables with fixed rows and columns. Every table has a defined structure before you insert data.

Relational Database

id | name | email | city

1 | Alice | alice@gmail.com | Mumbai

2 | Bob | bob@gmail.com | Delhi

id | user_id | product | amount

1 | 1 | Laptop | 80000

2 | 1 | Mouse | 1500

3 | 2 | Phone | 50000

SELECT users.name, orders.product

JOIN orders ON users.id = orders.user_id

WHERE users.id = 1

Alice | Laptop

Alice | Mouse

Fixed schema — you define columns before inserting data Tables are related to each other via foreign keys Uses SQL to query data Follows ACID properties

Key properties:

PostgreSQL, MySQL, SQLite, Oracle

Loading Relational Database