A SQL database (relational database) stores data in tables made of rows and columns, where relationships between tables are defined through keys. The engine that stores and manages this data is called an RDBMS — a Relational Database Management System.
Core Building Blocks
- Database — a container for related tables (e.g.
ecommerce_db) - Table — a structured set of rows and columns (e.g.
customers) - Row (record) — one entry in a table (one customer)
- Column (field) — one attribute of that entry (name, email, city)
- Schema — the overall structure: tables, columns, data types, and relationships
Example
A students table:
| student_id | name | course |
|---|---|---|
| 1 | Priya | Data Science |
| 2 | Rohit | Full Stack |
This is one table inside a database. Real applications have dozens of tables — students, courses, payments, attendance — linked together through keys (covered in Primary Key and Foreign Key).
Popular RDBMS
| Database | Type | Common Use |
|---|---|---|
| MySQL | Open-source | Web apps, general-purpose — most widely taught |
| PostgreSQL | Open-source | Complex queries, analytics, strong standards compliance |
| SQL Server | Commercial (Microsoft) | Enterprise, .NET ecosystems |
| Oracle | Commercial | Large enterprise systems, banking, telecom |
| SQLite | Embedded, file-based | Mobile apps, small local storage, prototyping |
The SQL you learn here is written primarily for MySQL (the most common starting point), with PostgreSQL and SQL Server differences called out wherever the syntax genuinely diverges.
Common Mistakes
- Confusing "database" (the container) with "table" (the structure inside it) — a beginner mistake that causes real confusion when reading documentation
- Assuming a "database" always means a full server — in tools like SQLite, a database is literally just a file
Interview Relevance
You may be asked to name differences between two RDBMS (commonly MySQL vs PostgreSQL). Focus on: licensing, JSON/array support (Postgres is stronger), replication, and typical use cases — rather than memorising version numbers.
Practice Question
List the database, table, and column names you'd expect in a simple food-delivery app storing restaurants, menu items, and orders.