TOPIC 01/3015 MINNOT STARTED

Tables, rows, columns and keys: what a database holds

Before any query, see what a database actually holds. Learn what a table, a row and a column are, why each column has a type, and how an id column names each row.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a paper register. The headings are printed across the top. Each line below is one item. You do not invent a new heading for a single line.

Daily List is a made-up to-do app (SYNTHETIC / TRAINING ONLY). Sam, the , learns to name the parts of tasks before he writes a query for Nina, the .

What it is: (Structured Query Language) is a language for asking a database questions and for changing what it stores. A are the grid, one record in it, and one kind of fact. The data type of a column says what kind of value that column holds, such as text or a whole number. A row identifier is a value that is different in every row, so it names one row. They live in the database. The neighbour of the row identifier is any other column, which may repeat.

A seven-row SQLite example has rowid, fruit, state, and price columns. Orange appears twice with two different row identifiers.
Read the diagram as text
  1. Columns: The table shows four fields: row identifier, fruit, state and price.
  2. Rows: Row 4 records a peach from South Carolina priced at 0.60. The four values belong to that one row.
  3. Identifiers: Orange appears in rows 1 and 23. The fruit name repeats, but each record has its own identifier.
Based on official sources

SQLite uses a fruit-price table in its query-planner guide. Read a row as one record, a column as one field, and the row identifier as a way to name a specific record.

Why it matters: If Sam sums a title, or treats two tasks as one because he ignored id, the report answers the wrong question. Naming the parts is the first check.

A paper line is one task. A database can hold many more lines, and the headings stay the same.

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the work.

THE REAL JOB A paper register with the same headings on every page.

  1. Name
  2. Types
  3. Id
Register

HOW THE PICTURE MAPS

How each part of the picture matches the work
In the pictureIn the work
A page of the registerA table
A lineA row
A headingA column
A line numberA row identifier

WHERE THIS PICTURE STOPS

  • A register is written by hand, but a table is enforced by the database.
  • A register has a few lines, but a table can hold millions.
  • A page can mix headings, but a table cannot.

HOOK

Same headings, many lines.

TELL A FRIEND

A register: fixed headings, many lines.

OFTEN MIXED UP WITH How apps talk: client, server and database. That topic shows where a database sits in a system. This one shows what is inside it.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. Market practice

    Constraints (PostgreSQL documentation, data definition chapter) ↗ — PostgreSQL Global Development Group · PostgreSQL 18, §5.5 CHECK/NOT NULL/UNIQUE/primary/foreign keys; publisher page opened6November 2026. Dialect scope explicit.

    §5.5 CHECK/NOT NULL/UNIQUE/primary/foreign keys. PostgreSQL18 implementation, not a universal SQL mandate. · Checked 2026-11-06

    PostgreSQL18 publisher documentation opened on6November2026: §5.5 CHECK/NOT NULL/UNIQUE/primary/foreign keys. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.

  2. Market practice

    SQLite: datatypes and affinity ↗ — SQLite project · SQLite: datatypes and affinity; Flexible types, boolean/date storage, collations; ordinary versus STRICT scope. Publisher page opened6November 2026.

    Flexible types, boolean/date storage, collations; ordinary versus STRICT scope. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  3. Market practice

    SQLite: STRICT tables ↗ — SQLite project · SQLite: STRICT tables; STRICT table restrictions, since 3.37.0. Publisher page opened6November 2026.

    STRICT table restrictions, since3.37.0. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  4. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    What this simplifies: Daily List people, data and exercises are invented for teaching. Query results belong to the declared fixture and database version. Authorization, business identity, time bounds and unknown-value policy must be agreed in context; no universal mandatory query template is implied.

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.