Databases

RDBMS — Relational Databases

Relational database fundamentals — tables, keys, relationships, normalization, and SQL — with schema examples and comparison tables.

  • RDBMS
  • SQL
  • Database Design
Relational database illustration

What is an RDBMS?

A Relational Database Management System (RDBMS) stores data in tables (relations) made of rows and columns, where relationships between tables are defined through keys rather than nested documents. PostgreSQL, MySQL, SQLite, and Oracle are all RDBMS engines.

Core Building Blocks

RDBMS vocabulary
termmeaning
TableA collection of rows with the same columns (schema)
Row / RecordA single entry in a table
Column / FieldA named, typed attribute shared by every row
Primary KeyUniquely identifies each row in a table
Foreign KeyA column referencing another table's primary key
IndexA structure that speeds up lookups on a column

A Simple Schema

Two related tables — authors and books — connected by a foreign key:

schema.sql
authorsid (PK)namecountrybooksid (PK)titleauthor_id (FK)published_year1 : many

Relationship Types

  • One-to-Many — one author can write many books (shown above).
  • Many-to-Many — many books can have many tags; needs a junction table (book_tags) with two foreign keys.
  • One-to-One — a user and their profile settings, split for organization or optional data.

Normalization, Briefly

Normalization organizes columns and tables to minimize redundancy:

Normal forms at a glance
formrulefixes
1NFAtomic columns, no repeating groupsMulti-valued columns
2NF1NF + no partial dependency on a composite keyPartial key dependency
3NF2NF + no transitive dependency on non-key columnsDerived/indirect data
BCNFEvery determinant is a candidate keyEdge cases 3NF misses

Denormalization (intentionally duplicating data) is sometimes used for read-heavy systems to trade storage for query speed — it’s a deliberate trade-off, not a mistake.

ACID Properties

RDBMS transactions guarantee:

  • Atomicity — a transaction fully succeeds or fully rolls back.
  • Consistency — the database moves between valid states only.
  • Isolation — concurrent transactions don’t interfere with each other.
  • Durability — once committed, data survives crashes.

When to Reach for an RDBMS

Structured data with clear relationships, a need for strong consistency (banking, inventory, orders), and complex queries joining multiple entities — an RDBMS is usually the right default before reaching for something more specialized.