Database basics · 数据库基础
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| database/ˈdeɪtəbeɪs/ | 数据库 | shù jù kù |
| record/ˈrekɔːd/ | 记录 | jì lù |
| field/fiːld/ | 字段 | zì duàn |
| primary key/ˈpraɪməri kiː/ | 主键 | zhǔ jiàn |
| data type/ˈdeɪtə taɪp/ | 数据类型 | shù jù lèi xíng |
| validation/ˌvælɪˈdeɪʃn/ | 验证 | 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 主键.
数据库
- 一个数据库(database)是一个有组织的数据存储,容易搜索、排序和更新。
- 在 IGCSE 你使用一个单表(single-table)数据库——所有数据在一个表中。
- 一个表由记录(records)和字段(fields)构成,带一个主键(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.
记录与字段
- 一个记录是一行(row)——关于一个事物的所有数据(一个学生)。
- 一个字段是一列(column)——每个记录都有的一条数据("First name")。
- 所以一个表是一个网格:每行是一个记录,每列是一个字段。

在一个单表数据库中每行是一个记录,每列是一个字段;主键(StudentID)对每个记录是唯一的。
Reading a table with SELECT · 用 SELECT 读一个表
A database table is rows (records) and columns (fields). WHERE keeps the rows that match; SELECT keeps only the columns you ask for. · 一个数据库表是行(记录)和列(字段)。WHERE 保留匹配的行;SELECT 只保留你要的列。
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.
字段的数据类型
- 每个字段存储一个数据类型,选来适合数据:
- text/alphanumeric(文本/字母数字,字母/数字/符号)、character(一个字符)、Boolean(布尔,TRUE/FALSE)、integer(整数)、real(小数)、date/time(日期/时间)。

大型数据库存储在数据中心的服务器上。
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.
主键与验证
- 一个主键是一个对每个记录都有唯一值的字段,所以它精确地挑出一个记录(例如
StudentID)。 - 一个像
FormClass这样的字段是一个糟糕的主键——许多学生共享一个班级。 - 验证(validation)在数据录入时检查它是否合理(对年龄的一个范围检查,一个存在检查使一个字段不为空)。

一个图书馆卡片目录是纸上的一个数据库——你能按索引搜索的记录。
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. · 一个主键必须对每个记录都有一个唯一的值,所以一个像 FormClass(被许多学生共享)这样的字段是一个糟糕的选择。
If a value repeats, it can't identify exactly one record — so you need a genuinely unique field (e.g. StudentID). · 如果一个值重复,它不能精确地标识一个记录——所以你需要一个真正唯一的字段(例如 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
你掌握了
- 一个数据库组织数据以便容易搜索/排序/更新;IGCSE 使用一个单表
- 一个记录 = 一行;一个字段 = 一列
- 为每个字段选一个数据类型(文本、布尔、整数、实数、日期/时间)
- 一个主键对每个记录是唯一的;验证检查数据是否合理