📚 Databases | 数据库
Databases are systematic collections of structured data, stored and managed electronically. They are the backbone of modern scientific research, enabling scientists to record experimental observations, share findings, and analyse large datasets with speed and accuracy. From tracking climate data to storing gene sequences, databases make scientific work more reliable and reproducible.
数据库是经过系统化组织的结构化数据集合,以电子方式存储和管理。它们是现代科学研究的支柱,使科学家能够记录实验观察、分享发现,并快速准确地分析大型数据集。从追踪气候数据到存储基因序列,数据库让科学工作更加可靠且具备可复现性。
1. What is a Database? | 什么是数据库?
A database is an organised store of related data that can be easily accessed, managed, and updated. Instead of keeping information in scattered files or unlinked spreadsheets, a database centralises data into a single system that many users can query simultaneously. In science, databases store measurement results, sample identifiers, and calibration records, making it much simpler to retrieve past experiments or combine data from different sources.
数据库是一个有组织的、相关数据的存储库,可以方便地访问、管理和更新。它把信息集中到一个系统中,而不是分散在零散文件或互不关联的电子表格里,允许多个用户同时查询。在科学领域,数据库用于存储测量结果、样品标识和校准记录,让调取以往的实验或整合来自不同来源的数据变得更加简单。
A database management system (DBMS) is the software that handles data storage, retrieval, and security. Common examples include MySQL, PostgreSQL, and Microsoft Access. In a school laboratory, a DBMS might help students track their titration readings, pH values, and reaction times without losing track of which data belongs to which trial.
数据库管理系统(DBMS)是处理数据存储、检索和安全的软件。常见的例子包括 MySQL、PostgreSQL 和 Microsoft Access。在学校实验室中,DBMS 可以帮助学生跟踪滴定读数、pH 值和反应时间,而不会混淆哪组数据属于哪次实验。
2. Why Use Databases in Science? | 为什么在科学中使用数据库?
Scientific investigations generate large volumes of data. Without a structured database, it is easy to misplace results, duplicate entries, or introduce errors when copying data from notebooks to analysis software. Databases provide a single source of truth, ensuring that every measurement is recorded only once and can be linked to the correct experimental conditions.
科学探究会产生海量数据。如果没有结构化的数据库,就容易丢失结果、重复录入,或在从笔记本向分析软件抄写数据时引入错误。数据库提供单一事实来源,确保每项测量只记录一次,并能关联到正确的实验条件。
Furthermore, databases support data integrity through validation rules. For instance, a field for temperature can be restricted to a sensible range (−20 °C to 150 °C for typical school experiments). Such checks catch mistakes at the point of entry, preventing impossible values from contaminating later analyses.
此外,数据库通过验证规则支持数据完整性。例如,温度字段可以限制在一个合理的范围内(典型学校实验为 −20 °C 到 150 °C)。这种检查在数据录入时就能捕捉错误,防止不可能的值污染后续分析。
3. Key Components: Tables, Fields and Records | 核心组件:表、字段和记录
le student or a specific experiment run. Each column is called a field (or attribute) and holds a particular type of information, such as 'StudentID', 'ExperimentDate', or 'ReactionTime_seconds'.
数据库以表格形式存储数据,表格由行和列组成。每一行称为一条记录(或元组),代表一个实体,比如一名学生或一次特定的实验运行。每一列称为一个字段(或属性),用于存放特定类型的信息,例如 'StudentID'、'ExperimentDate' 或 'ReactionTime_seconds'。
Consider a simple 'Experiments' table:
想象一个简单的 'Experiments' 表:
| ExperimentID | StudentName | Date | Temp_C | pH |
|---|---|---|---|---|
| 001 | Alice | 2025-06-10 | 22 | 6.5 |
| 002 | Bob | 2025-06-10 | 23 | 7.0 |
xperiment run is a record, and ExperimentID, StudentName, Date, Temp_C, and pH are fields.
在这里,每次实验运行是一条记录,ExperimentID、StudentName、Date、Temp_C 和 pH 是字段。
4. Data Types and Validation | 数据类型与验证
Every field in a database must have a defined data type that controls what kind of values can be stored. Common data types include INTEGER, REAL (or FLOAT), TEXT (or VARCHAR), DATE, and BOOLEAN. Choosing the correct data type helps the DBMS efficiently store values and prevents users from entering text where a number is expected.
数据库中的每个字段都必须具有定义的数据类型,控制可以存储什么类型的值。常见的数据类型包括 INTEGER(整数)、REAL(或 FLOAT,实数)、TEXT(或 VARCHAR,文本)、DATE(日期)和 BOOLEAN(布尔)。选择正确的数据类型有助于 DBMS 高效存储数值,并防止用户在需要数字处输入文本。
Validation rules add another layer of protection. For example, a field for 'Volume_mL' can be set with a rule '>= 0 AND <= 500' ecks ensure a field is not left blank, and format checks can enforce that dates follow the 'YYYY-MM-DD' e pattern. These features are vital in science, where a single impossible reading could mislead a whole investigation.
验证规则增加了另一层防护。例如,'Volume_mL' 字段可以设置规则 '>= 0 AND <= 500'。存在性检查确保字段不为空,格式检查可以强制日期遵循 'YYYY-MM-DD' 模式。这些功能在科学中至关重要,因为一个不可能的数据就可能误导整个调查。
5. Primary Keys and Unique Identifiers | 主键与唯一标识符
A primary key is a field (or combination of fields) that uniquely identifies each record in a table. In the 'Experiments' table above, ExperimentID could serve as the primary key because no two experiments should share the same ID. Primary keys must be unique and cannot contain NULL values.
主键是一个字段(或字段组合),用于唯一标识表中的每条记录。在上面的 'Experiments' 表中,ExperimentID 可作为主键,因为任何两次实验不应共享相同的 ID。主键必须唯一,且不能包含 NULL 值。
In scientific databases, primary keys are often made up of an auto-incrementing integer, a sample code, or even a timestamp if it is guaranteed to be unique. Using a primary key makes it easy to refer to a specific record when updating results or linking data across multiple tables.
在科学数据库中,主键通常由自动递增的整数、样本代码或保证唯一的时间戳构成。使用主键可以在更新结果或跨多个表关联数据时,方便地引用特定记录。
6. Relational Databases and Foreign Keys | 关系数据库与外键
Most scientific databases are relational — they consist of several linked tables to reduce data redundancy. Imagine a school lab that stores both student details and experiment results. Instead of writing the student's full name, class, and email in every experiment record, we can separate students into a 'Students' table and link it to the 'Experiments' table using a foreign key.
大多数科学数据库都是关系型的——它们由多个相互关联的表组成,以减少数据冗余。想象一个学校实验室需要存储学生信息和实验结果。与其在每条实验记录中重复学生的全名、班级和电子邮箱,不如将学生信息分离到 'Students' 表中,并通过外键将其与 'Experiments' 表关联起来。
A foreign key is a field in one table that refers to the primary key of another table. For instance, the 'Experiments' table might include a 'StudentID' field that matches the 'StudentID' primary key in the 'Students' table. This approach ensures data consistency: if a student's email changes, we update it in only one place.
外键是一个表中的字段,它引用另一个表的主键。例如,'Experiments' 表可能包含 'StudentID' 字段,该字段与 'Students' 表中的 'StudentID' 主键相匹配。这种方法确保了数据一致性:如果学生的电子邮箱发生变化,我们只需在一个地方进行更新。
7. Introduction to SQL: Querying Data | SQL 入门:查询数据
Structured Query Language (SQL) is the standard language for interacting with relational databases. The most common operation is the SELECT statement, which retrieves data from one or more tables. A basic query to fetch all records from the 'Experiments' table would be:
SELECT * FROM Experiments;
结构化查询语言(SQL)是与关系数据库交互的标准语言。最常见的操作是 SELECT 语句,它从一个或多个表中检索数据。一个从 'Experiments' 表获取所有记录的基本查询如下:
SELECT * FROM Experiments;
To filter results, scientists often add a WHERE clause. For example, to find experiments performed at a temperature above 30 °C, we would write:
SELECT * FROM Experiments WHERE Temp_C > 30;
为了筛选结果,科学家经常添加 WHERE 子句。例如,要找出在 30 °C 以上温度进行的实验,可写成:
SELECT * FROM Experiments WHERE Temp_C > 30;
SQL can also sort data using ORDER BY and perform calculations like COUNT, SUM, and AVERAGE. These capabilities allow researchers to quickly spot trends, anomalies, or outliers in their datasets without manual counting.
SQL 还可以使用 ORDER BY 对数据进行排序,并执行 COUNT、SUM 和 AVERAGE 等计算。这些功能使研究者能够快速发现数据集中的趋势、异常值或离群点,而无需手动计数。
8. Inserting, Updating and Deleting Records | 插入、更新和删除记录
Maintaining a scientific database involves more than just reading data. The INSERT statement adds new records, for example:
INSERT INTO Experiments (ExperimentID, StudentName, Date, Temp_C, pH) VALUES (003, 'Charlie', '2025-06-11', 21, 6.8);
维护科学数据库不仅仅涉及读取数据。INSERT 语句用于添加新记录,例如:
INSERT INTO Experiments (ExperimentID, StudentName, Date, Temp_C, pH) VALUES (003, 'Charlie', '2025-06-11', 21, 6.8);
When a mistake is discovered, the UPDATE statement modifies existing data. Suppose a thermometer was later recalibrated and all temperature readings need to be increased by 0.5 °C:
UPDATE Experiments SET Temp_C = Temp_C + 0.5;
当发现错误时,UPDATE 语句用于修改现有数据。假设温度计后来重新校准,所有温度读数需要增加 0.5 °C:
UPDATE Experiments SET Temp_C = Temp_C + 0.5;
The DELETE statement removes records, but must be used with caution — especially if a WHERE clause is omitted, it could erase the entire table. In science, deleting raw data is generally discouraged; instead, researchers flag invalid entries while keeping them for audit trails.
DELETE 语句用于删除记录,但必须谨慎使用——如果省略 WHERE 子句,可能会清空整个表。在科学中,通常不鼓励删除原始数据;相反,研究者会标记无效条目,同时将其保留以备审计追溯。
9. Databases vs Spreadsheets | 数据库与电子表格
Spreadsheets like Excel are excellent for small datasets and quick calculations, but they have limitations. They can become slow with thousands of rows, do not enforce data types strictly, and make it difficult for multiple users to edit data simultaneously without risking conflicts or overwritten entries.
像 Excel 这样的电子表格非常适用于小数据集和快速计算,但也存在局限性。当行数达到数千行时,它们会变得缓慢,不能严格强制数据类型,并且难以让多个用户同时编辑数据而不产生冲突或被覆盖的风险。
Databases excel at handling large volumes of structured data, supporting concurrent access, and maintaining referential integrity. They also allow users to query data with SQL, build reports, and create forms for data entry that automatically validate each field. For any long-term scientific project, a database is the more robust choice.
数据库在处理大量结构化数据、支持并发访问以及维护引用完整性方面表现出色。它们还允许用户使用 SQL 查询数据、生成报告,并创建可自动验证每个字段的数据输入表单。对于任何长期的科学项目,数据库是更稳健的选择。
10. Data Security and Ethics | 数据安全与伦理
Scientific databases often contain sensitive information — patient records in medical studies, endangered species locations in ecology, or student personal data in school projects. A DBMS provides security features such as user accounts, passwords, and access levels. A laboratory assistant might only have permission to view data, while the lead researcher can insert and update records.
科学数据库通常包含敏感信息——医学研究中的患者记录、生态学中濒危物种的位置,或学校项目中的学生个人数据。DBMS 提供用户账户、密码和访问级别等安全功能。实验室助理可能只有查看数据的权限,而首席研究员可以插入和更新记录。
Ethical guidelines require that personal data be anonymised where possible and used only for the purpose for which consent was given. In an IGCSE science project, students should ensure that any database containing classmates' results does not reveal identities and is stored securely. Backups are also essential to prevent data loss due to hardware failure.
伦理准则要求尽可能对个人数据进行匿名化处理,并仅用于获得同意的目的。在 IGCSE 科学项目中,学生应确保任何包含同学结果的数据库不泄露身份并且安全存储。备份同样至关重要,以防因硬件故障导致数据丢失。
11. Database Design for Science Experiments | 科学实验的数据库设计
A well-designed database for a science experiment starts by identifying the entities involved. For a chemistry investigation on reaction rates, entities might be 'Chemicals', 'Trials', 'Concentrations', and 'Observations'. Each entity becomes a table, and relationships are mapped using primary and foreign keys.
为科学实验设计良好的数据库首先要识别涉及的实体。对于关于反应速率的化学探究,实体可能包括 'Chemicals'、'Trials'、'Concentrations' 和 'Observations'。每个实体成为一个表,并通过主键和外键映射关系。
Normalisation is the process of organising tables to minimise duplication. For example, instead of writing the chemical name and molar mass in every trial record, we place chemical details in a 'Chemicals' table and reference the chemical ID in the 'Trials' table. This reduces storage space and avoids inconsistencies if a molar mass needs to be corrected later.
规范化是组织表以最大限度地减少重复的过程。例如,与其在每次试验记录中写下化学名称和摩尔质量,不如将化学详细信息放在 'Chemicals' 表中,并在 'Trials' 表中引用化学 ID。这减少了存储空间,并且避免后来需要修正摩尔质量时产生不一致。
A simple design for a reaction rate experiment might look like this: a 'Substances' table (SubstanceID, Name, MolarMass_gper_mol), a 'Trials' actionTime_s). Students can then query average reaction times per concentration using SQL.
一个反应速率实验的简单设计可能像这样:'Substances' 表(SubstanceID, Name, MolarMass_gper_mol),'Trials' 表(TrialID, SubstanceID, Concentration_mol_per_dm³, Temperature_C, ReactionTime_s)。然后,学生可以使用 SQL 查询每个浓度下的平均反应时间。
12. Summary and Revision Tips | 总结与复习提示
Databases are powerful tools for managing scientific data. Key concepts to remember include: the structure of tables (fields and records), the role of primary and foreign keys in relational databases, SQL commands for data retrieval and modification, and the importance of validation and security. Understanding how databases differ from spreadsheets helps you choose the right tool for each task.
数据库是管理科学数据的强大工具。需要记住的关键概念包括:表格的结构(字段和记录)、主键和外键在关系数据库中的作用、用于数据检索和修改的 SQL 命令,以及验证和安全的重要性。了解数据库与电子表格的不同之处有助于你为每项任务选择合适的工具。
For IGCSE revision, practise writing simple SQL queries to filter, sort, and join tables. Be able to identify a good primary key from a set of fields and explain why data redundancy is harmful in a scientific context. Remember that in an examination, you may be asked to design a database structure for a given scenario, so draw clear table diagrams and label relationships.
为了 IGCSE 复习,练习编写简单的 SQL 查询来筛选、排序和连接表。能够从一组字段中识别出好的主键,并解释为什么数据冗余在科学情境中是有害的。请记住,在考试中,你可能会被要求为给定场景设计数据库结构,因此要绘制清晰的表格示意图并标注关系。
Published by TutorHao | Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图