Database basics
| English | Chinese | Pinyin |
|---|---|---|
| database | 数据库 | shù jù kù |
| record | 记录 | jì lù |
| field | 字段 | zì duàn |
| primary key | 主键 | zhǔ jiàn |
| data type | 数据类型 | shù jù lèi xíng |
| validation | 验证 | yàn zhèng |
Databases 数据库
- A database is an organised store of data, easy to search, sort and update.
- At IGCSE you use a single-table database — all data in one table.
- A table is made of records 记录 and fields 字段, with a primary key 主键.
Records and fields
- A record is one row — all the data about one thing (one student).
- A field is one column — one piece of data every record has ("First name").
- So a table is a grid: each row is a record, each column is a field.

In a single-table database each row is a record and each column is a field; the primary key (StudentID) is unique for every record.
Reading a table with SELECT
A database table is rows (records) and columns (fields). WHERE keeps the rows that match; SELECT keeps only the columns you ask for.
In a database table, a record is:
A record is a row (all data about one item); a field is a column (one piece of data).
Data types 数据类型 for fields
- Each field stores one data type, chosen to fit the data:
- text/alphanumeric (letters/digits/symbols), character (one character), Boolean (TRUE/FALSE), integer (whole number), real (decimal), date/time.

Large databases are stored on servers in data centres.
Match each database term to what it is.
A table is rows (records) × columns (fields); the primary key uniquely identifies a row; each field has a data type.
The primary key and validation 验证
- A primary key is a field with a unique value for every record, so it picks out exactly one record (e.g.
StudentID). - A field like
FormClassis a bad primary key — many students share a class. - Validation checks data is sensible as it goes in (a range check on age, a presence check so a field isn't blank).

A library card catalogue is a database on paper — records you can search by index.
A primary key is a field that:
A primary key is unique, so it identifies exactly one record.
A primary key must have a unique value for every record, so a field like FormClass (shared by many students) is a poor choice.
If a value repeats, it can't identify exactly one record — so you need a genuinely unique field (e.g. StudentID).
A presence check on a database field ensures that:
A presence check requires data to be entered; a range check limits the value.
You've got it
- a database organises data for easy search/sort/update; IGCSE uses a single table
- a record = a row; a field = a column
- choose a data type per field (text, Boolean, integer, real, date/time)
- a primary key is unique for every record; validation checks data is sensible