📚 GCSE AQA Computer Science: Databases Key Points | GCSE AQA 计算机科学 数据库考点精讲
Databases form a core part of the GCSE AQA Computer Science specification. You need to understand how relational databases are structured, the roles of primary and foreign keys, normalisation concepts, and how to write and interpret simple SQL statements. This guide covers every essential point to help you master the topic and excel in your exam.
数据库是 GCSE AQA 计算机科学考纲的核心部分。你需要理解关系数据库的结构、主键和外键的作用、规范化的概念,以及如何编写和解读简单的 SQL 语句。本指南涵盖所有关键考点,助你彻底掌握该主题并在考试中脱颖而出。
1. What is a Database? | 什么是数据库?
A database is a structured, persistent collection of data that is organised so that it can be easily accessed, managed, and updated. It can store information about real‑world entities such as customers, orders, products or students.
数据库是一个结构化的、持久的数据集合,它被组织起来以便于访问、管理和更新。它可以存储关于真实世界实体的信息,例如客户、订单、产品或学生。
Databases are at the heart of most modern applications, from social media platforms to school management systems, because they provide efficient storage, rapid search capabilities and support for multiple concurrent users while maintaining data consistency.
数据库是大多数现代应用程序的核心,从社交媒体平台到学校管理系统,因为它们提供高效的存储、快速的搜索能力,并支持多个并发用户,同时保持数据一致性。
2. Flat-File Databases vs Relational Databases | 平面文件数据库与关系数据库
A flat-file database stores all data in a single table, much like a spreadsheet. While simple to set up, this approach often leads to data redundancy (the same piece of data stored multiple times) and can cause inconsistencies when data is updated in one place but not another.
平面文件数据库将所有数据存储在一个表中,很像电子表格。虽然设置简单,但这种方式通常会导致数据冗余(同一数据多次存储),并可能在数据仅在某一处更新时造成不一致。
A relational database splits data into multiple linked tables. Each table represents a logical entity, and relationships between tables are established using common fields (keys). This structure minimises redundancy, enforces data integrity and makes maintenance easier.
关系数据库将数据拆分到多个相互关联的表中。每个表代表一个逻辑实体,表之间的关系通过公共字段(键)建立。这种结构最大限度地减少了冗余,加强了数据完整性,并使维护更加容易。
For example, instead of storing a student’s name and contact details in every row of a ‘Results’ table, a relational database stores student details once in a ‘Students’ table and references them via a StudentID. This is the key advantage tested in AQA exams.
例如,不是将学生的姓名和联系方式存储在“成绩”表的每一行中,关系数据库将学生详细信息一次性存储在“学生”表中,并通过 StudentID 引用它们。这是 AQA 考试中考查的关键优势。
3. Key Terminology: Table, Record, Field and Data Types | 关键术语:表、记录、字段和数据类型
A clear understanding of the following terms is essential for answering both theoretical and SQL‑based questions.
清楚理解以下术语对于回答理论和 SQL 类题目至关重要。
Table (Entity): A collection of related records, organised in rows and columns. A table models one type of entity, e.g., a ‘Books’ table.
表 (实体): 一组相关的记录,按行和列组织。一个表模拟一种实体类型,例如“图书”表。
Record (Row/Tuple): A complete set of information about one specific instance of the entity. For example, all details belonging to a single book.
记录 (行/元组): 关于实体某一具体实例的完整信息集。例如,属于单本书的所有详细信息。
Field (Column/Attribute): A single characteristic or piece of data within a record, such as BookTitle, Author or ISBN. Every field has a specific data type.
字段 (列/属性): 记录中的单个特征或数据项,例如 BookTitle、Author 或 ISBN。每个字段都有特定的数据类型。
Data Type: Defines the kind of data a field can contain. The main SQL data types you must know for the AQA specification are:
数据类型: 定义字段可以包含的数据种类。你必须为 AQA 考纲掌握的主要 SQL 数据类型包括:
– TEXT (or VARCHAR): strings of characters, e.g. ‘John’.
– INTEGER: whole numbers, e.g. 42.
– REAL (or FLOAT): numbers with a decimal part, e.g. 19.99.
– DATE: date values in a standard format, e.g. ‘2025-05-20’.
– TEXT(或 VARCHAR):字符串,例如 ‘John’。
– INTEGER:整数,例如 42。
– REAL(或 FLOAT):带有小数部分的数字,例如 19.99。
– DATE:标准格式的日期值,例如 ‘2025-05-20’。
4. Primary Keys and Foreign Keys | 主键与外键
Primary Key: A unique identifier for each record in a table. No two records can have the same primary key value, and the field cannot be left empty (NOT NULL). Typically a student ID or product code is chosen. A primary key may consist of more than one field (composite key), but the GCSE syllabus focuses on single‑field primary keys.
主键: 表中每条记录的唯一标识符。没有两条记录可以具有相同的主键值,并且该字段不能为空 (NOT NULL)。通常选择学生 ID 或产品代码。主键可以由多个字段组成(复合键),但 GCSE 课程关注单字段主键。
Foreign Key: A field in one table that refers to the primary key of another table. It creates a logical relationship between the two tables. For instance, in a ‘Loans’ table, a BookID field might be a foreign key that points to the primary key (BookID) of the ‘Books’ table. Foreign keys enforce referential integrity – you cannot have a foreign key value that does not exist as a primary key in the referenced table.
外键: 一个表中引用另一个表主键的字段。它在两个表之间建立逻辑关系。例如,在“借阅”表中,BookID 字段可能是外键,指向“图书”表的主键 (BookID)。外键强制引用完整性——你不能有不作为引用表中主键存在的外键值。
5. Types of Relationships | 关系的类型
| Relationship | English Explanation | 中文解释 |
|---|---|---|
| One-to-One (1:1) | One record in Table A is linked to exactly one record in Table B. Rarely used; sometimes for splitting tables for security or performance. Example: a Country table and a CapitalCity table. | 表 A 中的一条记录恰好关联表 B 中的一条记录。很少使用;有时出于安全或性能原因拆分表。例如国家表和首都表。 |
| One-to-Many (1:M) | One record in Table A can be related to many records in Table B, but each record in Table B relates to only one record in Table A. The most common relationship. Example: one customer places many orders; an order belongs to one customer. | 表 A 中的一条记录可以与表 B 中的多条记录相关联,但表 B 中的每条记录仅与表 A 中的一条记录相关联。最常见的关系。示例:一位客户下多个订单;一个订单属于一位客户。 |
| Many-to-Many (M:N) | Many records in Table A can relate to many records in Table B. This is resolved by introducing a linking (junction) table containing two foreign keys, which transforms the relationship into two one‑to‑many relationships. Example: students and courses – a student enrols in many courses, and a course has many students. | 表 A 中的多条记录可以与表 B 中的多条记录关联。这通过引入一个包含两个外键的链接(连结)表来解决,该表将关系转化为两个一对多关系。示例:学生和课程——一个学生选修多门课程,一门课程有许多学生。 |
6. Entity Relationship Diagrams (ER Diagrams) | 实体关系图
An Entity Relationship Diagram (ERD) is a visual tool that represents the structure of a relational database. It helps in planning and communicating how tables are related before the database is built. For the GCSE exam, you should be able to interpret simple ERDs and possibly sketch them using the crow’s foot notation.
实体关系图 (ERD) 是表示关系数据库结构的可视化工具。它有助于在构建数据库之前规划和沟通表与表之间的关系。对于 GCSE 考试,你应该能够解读简单的 ERD,并可能使用鱼尾纹表示法进行绘制。
In crow’s foot notation: a single vertical line (|) represents ‘one’, and a three‑pronged fork (crow’s foot) represents ‘many’. A small circle (O) placed next to the symbol indicates optionality – meaning zero instances are allowed. A line with a single line at one end and a crow’s foot at the other therefore represents a one‑to‑many relationship. Most exam diagrams follow this language.
在鱼尾纹表示法中:单竖线 (|) 表示“一”,三叉分叉(鱼尾纹)表示“多”。放在符号旁边的小圆圈 (O) 表示可选性——意味着允许零个实例。因此,一端为单竖线、另一端为鱼尾纹的线代表一对多关系。大多数考试图表都遵循这种语言。
7. Introduction to SQL and Data Definition Basics | SQL 简介与数据定义基础
SQL stands for Structured Query Language. It is the standard language for interacting with relational database management systems (DBMS). AQA GCSE focuses on Data Manipulation Language (DML) commands, but you should also recognise the purpose of Data Definition Language (DDL) commands like CREATE TABLE, which sets up the structure of the database.
SQL 代表结构化查询语言。它是与关系数据库管理系统 (DBMS) 交互的标准语言。AQA GCSE 侧重于数据操作语言 (DML) 命令,但你也应认识到数据定义语言 (DDL) 命令(如 CREATE TABLE)的目的,这些命令用于设置数据库的结构。
When designing a table using SQL, you must specify a data type for each field. For example, a simple table creation statement might look like this (exam papers often present the table headings rather than raw DDL):
使用 SQL 设计表时,必须为每个字段指定数据类型。例如,一个简单的建表语句可能如下所示(试卷通常呈现表头而不是原始 DDL):
CREATE TABLE Students (StudentID INTEGER PRIMARY KEY, Name TEXT, DateOfBirth DATE, TutorGroup TEXT);
CREATE TABLE Students (StudentID INTEGER PRIMARY KEY, Name TEXT, DateOfBirth DATE, TutorGroup TEXT);
8. Retrieving Data with SELECT and WHERE | 使用 SELECT 和 WHERE 检索数据
The SELECT statement fetches data from a table. The basic structure is:
SELECT 语句从表中提取数据。基本结构为:
SELECT field1, field2 FROM TableName;
SELECT 字段1, 字段2 FROM 表名;
If you want to retrieve all fields, use the wildcard asterisk: SELECT * FROM Students; However, in exams it’s better practice to name the required fields explicitly.
如果要检索所有字段,请使用通配符星号:SELECT * FROM Students; 然而,在考试中更佳的做法是显式命名所需字段。
The WHERE clause applies a filter so that only records meeting a specified condition are returned. Conditions use comparison operators: = (equal to), <> (not equal to), , >=. Logical operators AND and OR can combine conditions.
WHERE 子句应用筛选条件,以便仅返回满足指定条件的记录。条件使用比较运算符:= (等于)、<> (不等于)、、>=。逻辑运算符 AND 和 OR 可组合条件。
Example: List the names and grades of students who scored above 70 in Mathematics:
示例:列出数学成绩高于 70 分的学生的姓名和分数:
SELECT StudentName, Grade FROM Results WHERE Subject = ‘Maths’ AND Grade > 70;
SELECT StudentName, Grade FROM Results WHERE Subject = ‘Maths’ AND Grade > 70;
Remember that text values must be enclosed in single quotes (‘ ‘), while numeric values are written without quotes. Case sensitivity depends on the DBMS, but AQA examples follow case‑
Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply