foundation Estimated learning time: 10 h

P-6.1 The Relational Model

You can describe data as tables with keys and relationships, explain what a primary and a foreign key enforce, and say what a database gives you that a file does not.

Before any query syntax, the model itself is worth understanding: data as tables, rows identified by keys, and relationships expressed by referring to those keys. What makes it powerful is that the database enforces the rules rather than the application, so a defect in one program cannot leave the data in a state no program expects. That guarantee is the whole reason to use a database rather than a folder of files.

Work through these

  • Tables, rows, columns and types

    A table is a set of rows with the same named, typed columns, and the type is enforced on write. That is already more than most file formats promise.

    NPTEL: Data Base Management System · Course
  • Primary keys: what makes a row identifiable

    A primary key is the column or columns that uniquely identify a row, and the database refuses duplicates and missing values. Choosing it well is the first design decision you make.

  • Foreign keys: relationships the database itself enforces

    Referring to a key in another table lets the database refuse rows that point at nothing. This is what stops orphaned records accumulating quietly for years.

  • One-to-many and many-to-many, and the join table

    One side holding the other's key handles one-to-many; a many-to-many relationship needs a table of its own holding both keys. Recognising which one you have prevents most schema mistakes.

  • What a database gives you that a file does not

    Concurrent access, enforced constraints, recovery after a crash and a query language you did not have to write. Each of those is months of work to reproduce badly.

Sign in to keep your progress.

Free resources

Links last checked 31 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.