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.
Read the diagram as text
- Columns: The table shows four fields: row identifier, fruit, state and price.
- Rows: Row 4 records a peach from South Carolina priced at 0.60. The four values belong to that one row.
- Identifiers: Orange appears in rows 1 and 23. The fruit name repeats, but each record has its own identifier.
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.
- Name
- Types
- Id
HOW THE PICTURE MAPS
| In the picture | In the work |
|---|---|
| A page of the register | A table |
| A line | A row |
| A heading | A column |
| A line number | A 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
- 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.
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.
- 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.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
SQLite: STRICT tables ↗ — SQLite project · SQLite: STRICT tables; STRICT table restrictions, since 3.37.0. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
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.
