← 返回资讯屏轩教育 · 行业资讯

Mastering Databases for GCSE Edexcel Computer Science | GCSE Edexcel 计算机:数据库 考点精讲

2026-07-13 22:40 · 本文部分内容由AI辅助创作

📚 Mastering Databases for GCSE Edexcel Computer Science | GCSE Edexcel 计算机:数据库 考点精讲

Databases are at the heart of almost every modern application, from online shopping to social media. For the GCSE Edexcel Computer Science exam, you need to understand what a database is, how relational databases are structured, and how to use basic SQL to manipulate data. This revision guide walks you through every key concept, giving you clear explanations in both English and Chinese so you can be confident on exam day.

数据库是几乎所有现代应用程序的核心,从网上购物到社交媒体。对于 GCSE Edexcel 计算机科学考试,你需要理解什么是数据库、关系型数据库的结构,以及如何使用基本的 SQL 操作数据。这份复习指南将带你梳理每一个关键概念,并用中英双语清晰解释,帮助你在考试日充满信心。

1. What is a Database? | 什么是数据库?

A database is an organised collection of data stored electronically. Instead of keeping scattered text files or spreadsheets, a database allows you to store, search, sort, and retrieve information efficiently. In a database, data is structured to prevent unnecessary duplication and to support powerful queries.

数据库是以电子方式存储的有组织的数据集合。与散乱的文本文件或电子表格不同,数据库允许你高效地存储、搜索、排序和检索信息。在数据库中,数据结构化存储以防止不必要的重复,并支持强大的查询。

Databases are managed by a Database Management System (DBMS) such as MySQL, Microsoft Access, or SQLite. The DBMS handles security, multi-user access, and backup, while providing an interface for users and programmers to interact with the data.

数据库由数据库管理系统(DBMS)管理,例如 MySQL、Microsoft Access 或 SQLite。DBMS 负责处理安全性、多用户访问和备份,同时为用户和程序员提供与数据交互的接口。


2. Flat-File vs Relational Databases | 平面文件数据库与关系型数据库

A flat-file database stores all data in a single table. It is simple but can lead to data redundancy (repetition) and inconsistency. For example, a flat-file of books might repeat the publisher’s address for every book from that publisher.

平面文件数据库将所有数据存储在一张表中。它很简单,但会导致数据冗余(重复)和不一致。例如,一个图书的平面文件可能会为同一出版社的每本书重复记录出版社地址。

A relational database splits data into linked tables, each focusing on a specific entity (e.g., students, courses, teachers). Relationships are created using keys, which reduces repetition and keeps data consistent. This is the type you need to know for GCSE Edexcel.

关系型数据库将数据拆分到相互关联的表中,每张表关注一个特定的实体(例如学生、课程、教师)。利用键来建立关系,这样可以减少重复并保持数据一致性。这是 GCSE Edexcel 考试要求掌握的类型。


3. Tables, Fields, Records | 表、字段、记录

In a relational database, data is organised into tables. Each table has a name and consists of columns and rows.

在关系型数据库中,数据被组织成表。每张表有一个名称,由列和行组成。

Think of a table like a grid: each column is a field defining what type of data is stored; each row is a record containing actual data. For example, a Students table might have fields: StudentID, FirstName, LastName, YearGroup.

可以将表想象成一个网格:每一列是一个字段,定义存储的数据类型;每一行是一条记录,包含实际数据。例如,Students 表可能有字段:StudentID、FirstName、LastName、YearGroup。


4. Primary Keys and Foreign Keys | 主键与外键

Primary Key: A field that uniquely identifies each record in a table. It must be unique and cannot be empty (NULL). For example, StudentID is a perfect primary key because no two students share the same ID.

主键: 唯一标识表中每条记录的字段。它必须唯一且不能为空(NULL)。例如,StudentID 是一个完美的主键,因为没有两个学生会共享同一个学号。

Foreign Key: A field in one table that refers to the primary key of another table. It creates a link between tables. For instance, a ClassEnrolment table might contain StudentID as a foreign key, linking each enrolment to a specific student in the Students table.

外键: 一张表中指向另一张表主键的字段。它创建表之间的链接。比如,ClassEnrolment 表可能包含 StudentID 作为外键,将每个选课记录关联到 Students 表中的特定学生。

Using foreign keys enforces referential integrity – you cannot add an enrolment for a student that does not exist in the parent table.

使用外键可以强制引用完整性——你不能为父表中不存在的学生添加选课记录。


5. Data Types and Validation | 数据类型与验证

When you design a table, each field is assigned a data type. Common types include:

设计表时,每个字段都被分配一个数据类型。常见类型包括:

Data Type / 数据类型Description / 描述Example / 示例
INTEGERWhole number / 整数42, 2024
VARCHAR / TEXTString of characters / 字符串'Alice'
DATE / DATETIMEDate or timestamp / 日期或时间戳'2025-05-14'
BOOLEANTrue/False / 布尔值TRUE
DECIMAL / REALNumber with decimals / 带小数点的数19.99

Validation rules check that data entered is sensible. Examples include presence check, length check, range check, and format check. Validation does not guarantee data is correct, only that it follows the rules.

验证规则检查输入的数据是否合理。例如存在性检查、长度检查、范围检查和格式检查。验证不能保证数据正确,只保证它遵循规则。


6. Introduction to SQL | SQL 入门

SQL (Structured Query Language) is the standard language for managing relational databases. You will be expected to write simple SQL statements in the exam. SQL uses keywords like SELECT, FROM, WHERE, INSERT, UPDATE, and DELETE.

SQL(结构化查询语言)是管理关系型数据库的标准语言。考试中你会被要求编写简单的 SQL 语句。SQL 使用的关键词有 SELECT、FROM、WHERE、INSERT、UPDATE 和 DELETE。

An SQL statement always ends with a semicolon ;. Strings are enclosed in single quotes ' '.

SQL 语句以分号 ; 结尾。字符串用单引号 ' ' 括起来。

A simple retrieval query has the form:

简单的检索查询形式如下:

SELECT field1, field2 FROM tableName WHERE condition;


广告 / Sponsored

7. SQL SELECT Queries | SQL SELECT 查询

The SELECT statement is used to fetch data from a database. You can select specific columns or use an asterisk * to select all columns.

SELECT 语句用于从数据库中提取数据。你可以选择特定的列,或者使用星号 * 来选择所有列。

Example – select all records from the Students table:

示例 – 从 Students 表中选择所有记录:

SELECT * FROM Students;

Example – select only first names and year groups of students in Year 11:

示例 – 只选择 Year 11 学生的名字和年级:

SELECT FirstName, YearGroup FROM Students WHERE YearGroup = 11;

The WHERE clause filters results. You can use operators like =, >, <, &gt;=, &lt;=, <> (not equal). String comparisons use single quotes. You can also use ORDER BY to sort results.

WHERE 子句用于过滤结果。你可以使用运算符 =、>、<、&gt;=、&lt;=、<>(不等于)。字符串比较使用单引号。你还可以使用 ORDER BY 对结果进行排序。

SELECT * FROM Products WHERE Price < 20 ORDER BY ProductName ASC;

This returns all products cheaper than 20, sorted alphabetically by name.

此查询返回价格低于 20 的所有产品,按产品名称字母升序排列。


8. SQL INSERT, UPDATE, DELETE | SQL 插入、更新、删除

INSERT adds a new record to a table. You must specify the values for each field in the correct order.

INSERT 向表中添加一条新记录。你必须按正确顺序为每个字段指定值。

INSERT INTO Students (StudentID, FirstName, LastName, YearGroup) VALUES (105, 'Tom', 'Hill', 10);

UPDATE modifies existing records. Always pair it with a WHERE clause to target specific rows – otherwise you will update everything!

UPDATE 修改现有记录。务必配合 WHERE 子句以定位特定行,否则你会更新所有记录!

UPDATE Students SET YearGroup = 11 WHERE StudentID = 105;

DELETE removes records. Again, use WHERE carefully; omitting it deletes all rows.

DELETE 删除记录。同样要谨慎使用 WHERE;若省略则会删除所有行。

DELETE FROM Students WHERE YearGroup = 13;


9. Data Integrity and Normalisation | 数据完整性与规范化

Data integrity means the data is accurate, consistent, and reliable. This is achieved through validation, primary keys restricting duplicates, and foreign keys maintaining referential integrity.

数据完整性意味着数据准确、一致且可靠。通过验证、主键限制重复以及外键维护引用完整性来实现。

Normalisation is the process of designing tables to minimise redundancy (repeated data). For GCSE, you should be aware that a well-designed relational database is usually normalised to the third normal form (3NF), which ensures every non-key field depends on 'the key, the whole key, and nothing but the key'.

规范化是设计表以减少冗余(重复数据)的过程。对于 GCSE,你应该知道一个设计良好的关系型数据库通常规范化到第三范式(3NF),它确保每个非键字段依赖于“键,整个键,只有键”。

Example anomaly: storing a teacher’s phone number in every class record – if the number changes, you must update it in many places. Normalisation moves the teacher’s phone number into a separate Teachers table linked by TeacherID.

异常示例:在每个班级记录中存储教师的电话号码——如果号码变了,你必须在多处更新。规范化将教师的电话号码移到单独的 Teachers 表中,通过 TeacherID 关联。


10. Advantages of Databases | 数据库的优势

Compared to paper-based or flat-file systems, databases offer:

与纸质系统或平面文件系统相比,数据库提供以下优势:


11. Database Management Systems (DBMS) | 数据库管理系统

A DBMS is the software that sits between the user and the database. It provides tools for creating tables, running queries, setting up relationships, and managing security. Examples include MySQL, Microsoft SQL Server, SQLite, and Oracle. For your exam, you may need to recognise that a DBMS is what makes database operations possible without direct file manipulation.

DBMS 是位于用户和数据库之间的软件。它提供创建表、运行查询、建立关系和管理安全性等工具。例子包括 MySQL、Microsoft SQL Server、SQLite 和 Oracle。考试中,你可能需要认识到正是 DBMS 使得无需直接操作文件就能进行数据库操作。


12. Exam Tips | 考试技巧


Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com

广告 / Sponsored
培生爱德思计算机科学学生用书教材Pearson Edexcel International GCSE Computer…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥349.0

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao