📚 IGCSE Edexcel Computer Science: Database Key Points | IGCSE Edexcel 计算机数据库考点精讲
Databases are at the heart of almost every modern software application, from social media to online banking. For the IGCSE Edexcel Computer Science exam, you need to understand the core concepts of databases, including relational models, keys, SQL, and data integrity. This guide breaks down each essential topic with clear explanations and practical examples, helping you answer both theory and application questions with confidence.
数据库是现代软件应用的核心,从社交媒体到网上银行。在 IGCSE Edexcel 计算机科学考试中,你需要掌握数据库的核心概念,包括关系模型、主键与外键、SQL 以及数据完整性。本指南用清晰的解释和实用示例逐一拆解每个关键主题,帮助你从容应对理论与应用题。
1. What is a Database? | 什么是数据库?
A database is a structured collection of data that is stored and accessed electronically. Unlike a simple spreadsheet or a flat file, a database allows multiple users and applications to manage and retrieve data efficiently through a Database Management System (DBMS). The data is organised in a way that reduces redundancy and makes it easier to search, sort, and update.
数据库是以电子方式存储和访问的结构化数据集合。与简单的电子表格或平面文件不同,数据库允许多个用户和应用程序通过数据库管理系统 (DBMS) 高效管理和检索数据。数据以降低冗余的方式组织,方便查询、排序和更新。
Common everyday examples include a school’s student information system, an online store’s product catalogue, and hospital patient records. In IGCSE, we focus on relational databases, where data is stored in tables linked by keys.
我们日常常见的例子包括学校的学生信息系统、网上商店的产品目录和医院的病人记录。在 IGCSE 中,我们重点学习关系型数据库,其数据存储在通过键关联的表中。
2. Relational Databases and Tables | 关系型数据库与表
A relational database organises data into one or more tables. Each table consists of rows and columns. A row represents a single record or entity (e.g. one student), while a column represents a field or attribute (e.g. student name, date of birth). Tables can be linked together using key fields, allowing data from different tables to be combined without duplication.
关系型数据库将数据组织到一个或多个表中。每个表由行和列组成。一行代表一条记录或一个实体(例如一名学生),一列代表一个字段或属性(例如学生姓名、出生日期)。表之间可以通过键字段链接,这样就能在不发生重复的前提下组合来自不同表的数据。
For example, a school database might have a ‘Students’ table and a ‘Classes’ table. Rather than storing all class details inside the student record, a relationship is created so that each student can be assigned to a class by referencing a class ID. This design is the foundation of relational databases and is tested frequently.
例如,学校数据库可能有一张“学生”表和一张“班级”表。我们不会把班级的所有详细信息都塞进学生记录中,而是通过引用班级 ID 建立关系,将每个学生分配到相应班级。这种设计是关系型数据库的基础,也是考试中经常考查的内容。
3. Fields, Records, and Data Types | 字段、记录与数据类型
A field (column) is a single piece of data stored in a table, such as ‘LastName’ or ‘DateOfBirth’. Each field has a defined data type that determines what kind of values it can hold. Common data types in IGCSE Edexcel include text/string (alphanumeric), integer (whole numbers), real/float (decimal numbers), date/time, and Boolean (true/false). Choosing the correct data type is important for validation and storage efficiency.
字段(列)是表中存储的单个数据,如“姓氏”或“出生日期”。每个字段都定义了数据类型,决定它可以保存哪种数值。IGCSE Edexcel 常见的数据类型包括文本/字符串、整数、实数/浮点数、日期/时间以及布尔值(真/假)。选择正确的数据类型对于数据验证和存储效率至关重要。
A record (row) is a complete set of fields about one item or entity. For instance, a record in a library database might contain the book title, author, ISBN and publication year. The combination of fields and records forms the table structure we work with in SQL.
记录(行)是关于某一项或实体的完整字段集合。例如,图书馆数据库中的一条记录可能包含书名、作者、ISBN 和出版年份。字段与记录的组合构成了我们在 SQL 中操作的表结构。
4. Primary Keys and Foreign Keys | 主键与外键
A primary key is a field (or combination of fields) that uniquely identifies each record in a table. No two records can have the same primary key value, and it cannot be left blank. Typical primary keys are ID numbers, such as StudentID or ProductCode. The primary key enforces entity integrity, ensuring each record is distinct.
主键是唯一标识表中每条记录的一个字段(或字段组合)。不能有两条记录具有相同的主键值,且主键不可为空。常见的主键有学号、商品代码等。主键确保了实体完整性,保证每条记录都是唯一的。
A foreign key is a field in one table that refers to the primary key of another table. It creates a link between two tables and is essential for maintaining referential integrity. For example, an ‘Orders’ table may include a ‘CustomerID’ field that matches the primary key in the ‘Customers’ table. This way, the database knows which customer placed which order.
外键是一张表中引用另一张表主键的字段。它在两张表之间建立链接,并对维护引用完整性至关重要。例如,“订单”表可能包含“顾客 ID”字段,该字段与“顾客”表中的主键相匹配。这样数据库就能知道哪个顾客下了哪些订单。
5. Database Management System (DBMS) | 数据库管理系统
A Database Management System (DBMS) is software that allows users to define, create, query, update and administer databases. It acts as an interface between the user and the database files. Popular DBMS examples include Microsoft Access, MySQL, Oracle, and SQLite. The DBMS handles security, concurrency, backup, and data integrity, so users do not need to manage files directly.
数据库管理系统 (DBMS) 是允许用户定义、创建、查询、更新和管理数据库的软件。它充当用户和数据库文件之间的接口。常见的 DBMS 包括 Microsoft Access、MySQL、Oracle 和 SQLite。DBMS 负责安全、并发控制、备份和数据完整性,用户无需直接管理文件。
In the exam, you might be asked to compare a database approach with a flat-file approach. A DBMS reduces data duplication, offers multi-user access with permission levels, and supports complex queries using SQL. Understanding the role of the DBMS helps you explain why organisations prefer databases over spreadsheets for large-scale data.
考试中可能会要求你比较数据库方法与平面文件方法。DBMS 可减少数据重复,提供带权限级别的多用户访问,并支持通过 SQL 进行复杂查询。理解 DBMS 的作用有助于解释为什么组织在处理大规模数据时更青睐数据库而非电子表格。
6. SQL Data Retrieval: SELECT, WHERE, ORDER BY | SQL 数据查询:SELECT, WHERE, ORDER BY
Structured Query Language (SQL) is used to communicate with a relational database. The most common command is SELECT, which retrieves data from one or more tables. You can specify the fields to display and the table name. The WHERE clause filters records based on a condition, and ORDER BY sorts the results in ascending (ASC) or descending (DESC) order.
结构化查询语言 (SQL) 用于与关系型数据库通信。最常用的命令是 SELECT,它从一个或多个表中检索数据。你可以指定要显示的字段和表名。WHERE 子句根据条件过滤记录,ORDER BY 则将结果按升序 (ASC) 或降序 (DESC) 排列。
Example: to find all students older than 15, sorted by name, you would write:
SELECT StudentName, Age FROM Students WHERE Age > 15 ORDER BY StudentName ASC;
示例:要查找所有年龄大于 15 岁的学生,并按姓名排序,可以编写:
SELECT StudentName, Age FROM Students WHERE Age > 15 ORDER BY StudentName ASC;
You may also use wildcards with LIKE, e.g. WHERE Name LIKE ‘A%’ finds names starting with A. Exam questions often ask you to predict the output of a given SQL statement or to write the correct SQL for a described scenario.
你还可以结合 LIKE 使用通配符,例如 WHERE Name LIKE ‘A%’ 可查找以 A 开头的姓名。考题经常要求你预测给定 SQL 语句的输出结果,或根据描述的场景写出正确的 SQL。
7. SQL Data Manipulation: INSERT, UPDATE, DELETE | SQL 数据操作:INSERT, UPDATE, DELETE
Beyond retrieval, SQL provides commands to modify data. INSERT adds new records: INSERT INTO Students (StudentID, Name, Age) VALUES (104, ‘Ahmed’, 17);. UPDATE changes existing data: UPDATE Students SET Age = 18 WHERE StudentID = 104;. DELETE removes records: DELETE FROM Students WHERE StudentID = 104;.
除了查询,SQL 还提供修改数据的命令。INSERT 添加新记录:INSERT INTO Students (StudentID, Name, Age) VALUES (104, ‘Ahmed’, 17);。UPDATE 更改现有数据:UPDATE Students SET Age = 18 WHERE StudentID = 104;。DELETE 删除记录:DELETE FROM Students WHERE StudentID = 104;。
It is critical to include the WHERE clause in UPDATE and DELETE statements; otherwise, all records in the table will be affected. In IGCSE, you may be given a table and asked to write the correct SQL to insert, update, or delete records matching certain criteria.
在 UPDATE 和 DELETE 语句中加入 WHERE 子句非常关键,否则表中的所有记录都会受到影响。在 IGCSE 中,你可能会看到一张表,并被要求写出正确的 SQL 来插入、更新或删除符合特定条件的记录。
8. Data Integrity and Validation | 数据完整性与验证
Data integrity means that data is accurate, consistent, and reliable throughout its lifecycle. Two key types are entity integrity (ensured by a primary key that is unique and not null) and referential integrity (ensuring foreign key values match existing primary keys or are null). These rules prevent orphan records and duplication.
数据完整性指数据在其整个生命周期中都是准确、一致和可靠的。两种关键类型是实体完整性(通过唯一且非空的主键来保证)和引用完整性(确保外键值与现有主键匹配或为空)。这些规则可以防止孤立记录和重复。
Validation is the process of checking data as it is entered to reduce errors. Common validation checks include presence check (field not left blank), range check (age between 0 and 120), format check (email contains ‘@’), length check, and lookup check. Validation does not guarantee correctness, but it helps catch obvious mistakes before storage.
验证是在数据录入时对其进行检查以减少错误的过程。常见的验证检查包括存在性检查(字段不能留空)、范围检查(年龄在 0 到 120 之间)、格式检查(电子邮件包含“@”)、长度检查和查阅检查。验证并不能保证数据的正确性,但有助于在存储前发现明显的错误。
9. Normalisation and First Normal Form (1NF) | 规范化与第一范式 (1NF)
Normalisation is a design technique used to minimise data redundancy and avoid update anomalies by organising fields into appropriate tables. The exam mainly focuses on First Normal Form (1NF). A table is in 1NF if each field contains only atomic (indivisible) values and there are no repeating groups of columns.
规范化是一种设计技术,通过将字段组织到合适的表中来尽量减少数据冗余并避免更新异常。考试主要关注第一范式 (1NF)。如果每个字段只包含原子(不可再分)值且没有重复的列组,则该表满足 1NF。
For example, a table with columns ‘StudentID, Subject1, Subject2, Subject3’ contains a repeating group and is not in 1NF. To achieve 1NF, you would create a separate ‘Enrolment’ table with one row per student-subject combination. Normalisation helps keep databases efficient and databases easier to maintain.
例如,一张包含“StudentID, Subject1, Subject2, Subject3”列的表存在重复组,不符合 1NF。要达到 1NF,应创建单独的“选课”表,每个学生-科目组合作为一行。规范化有助于保持数据库的高效性,并使其更易于维护。
10. Advantages of Databases and Security | 数据库的优势与安全
Compared to flat files, databases offer numerous advantages: reduced data redundancy, improved data consistency, efficient querying with SQL, concurrent access for multiple users, and centralised security. Because data is shared rather than duplicated, updates happen once and all users see the correct information.
与平面文件相比,数据库具有诸多优势:减少数据冗余、提高数据一致性、利用 SQL 高效查询、支持多用户并发访问以及集中安全管理。因为数据是共享而非复制的,一次更新就能让所有用户看到正确信息。
Security measures are essential to protect sensitive information. Database administrators can set user permissions (e.g. read-only, full access), enforce password authentication, encrypt data at rest, and schedule regular backups. These controls help maintain confidentiality and availability – key topics in the IGCSE syllabus.
安全措施对于保护敏感信息至关重要。数据库管理员可以设置用户权限(如只读、完全访问)、强制执行密码认证、对静态数据加密以及安排定期备份。这些控制措施有助于维护数据的机密性和可用性,是 IGCSE 大纲中的重点主题。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导