slug
databasea
type
Post
status
Published
category
7-CIE 9618
date
Nov 1, 2024
summary
tags
concepts
Syllabus
password
icon
8 Databases
8 数据库
8.1 Database Concepts
8.1 数据库概念
Candidates should be able to:
考生应能够:
Show understanding of the limitations of using a filebased approach for the storage and retrieval of data
理解使用基于文件的方法存储和检索数据的局限性
Describe the features of a relational database that address the limitations of a file-based approach
描述关系数据库的特点,解决基于文件方法的局限性
Show understanding of and use the terminology associated with a relational database model
理解并使用与关系数据库模型相关的术语
Use an entity-relationship (E-R) diagram to document a database design
使用实体-关系(E-R)图来记录数据库设计
Show understanding of the normalisation process
理解规范化过程
Explain why a given set of database tables are, or are not, in 3NF
解释为什么给定的数据库表集合处于,或不处于,第三范式(3NF)
Produce a normalised database design for a description of a database, a given set of data, or a given set of tables
为数据库描述、给定的数据集或给定的表集合生成一个规范化的数据库设计
8.2 Database Management Systems (DBMS)
8.2 数据库管理系统(DBMS)
Candidates should be able to:
考生应能够:
Show understanding of the features provided by a Database Management System (DBMS) that address the issues of a file based approach
理解数据库管理系统(DBMS)提供的功能,解决基于文件方法的问题
Show understanding of how software tools found within a DBMS are used in practice
理解数据库管理系统(DBMS)中的软件工具在实际中如何使用
8.3 Data Definition Language (DDL) and Data Manipulation Language (DML)
8.3 数据定义语言(DDL)和数据操纵语言(DML)
Candidates should be able to:
考生应能够:
Show understanding that the DBMS carries out all creation/modification of the database structure using its Data Definition Language (DDL)
理解DBMS使用其数据定义语言(DDL)执行数据库结构的所有创建/修改
Show understanding that the DBMS carries out all queries and maintenance of data using its DML
理解DBMS使用其数据操纵语言(DML)执行所有查询和数据维护
Show understanding that the industry standard for both DDL and DML is Structured Query Language (SQL)
理解DDL和DML的行业标准是结构化查询语言(SQL)
Understand given SQL (DDL) statements and be able to write simple SQL (DDL) statements using a sub-set of statements
理解给定的SQL(DDL)语句,并能够使用一组子语句编写简单的SQL(DDL)语句
Write an SQL script to query or modify data (DML) which are stored in (at most two) database tables
编写SQL脚本来查询或修改存储在(最多两个)数据库表中的数据
This outline covers a detailed overview of database concepts, database management systems (DBMS), and essential database languages (DDL and DML). Let's dive deeper into each topic:
8.1 Database Concepts
Limitations of a File-Based Approach
A file-based approach organizes data in separate files, often leading to challenges in scalability and consistency. Key limitations include:
- Data Redundancy and Inconsistency: Data is duplicated across multiple files, leading to inconsistency and increased storage requirements.
- Data Isolation: Retrieving related data spread across multiple files can be challenging.
- Limited Data Integrity: Maintaining rules to ensure data accuracy (like foreign keys) is hard to enforce.
- Concurrency Issues: File-based systems struggle with multiple users accessing data simultaneously.
- Security and Access Control: Difficulties arise in implementing robust access controls for sensitive data.
Features of a Relational Database Addressing File-Based Limitations
Relational databases solve many of the issues inherent in file-based systems:
- Data Consistency: By centralizing data, relational databases reduce redundancy.
- Data Integrity: Constraints like primary keys and foreign keys maintain data accuracy.
- Efficient Data Access: SQL enables complex querying, reducing the difficulty of retrieving related data.
- Concurrency Control: Databases can handle multiple users with mechanisms to manage simultaneous access.
- Enhanced Security: Access controls at the table or even column level help secure data.
Relational Database Terminology
Key terms include:
- Table (Relation): A collection of rows and columns representing an entity.
- Field (Attribute): A column in a table.
- Record (Tuple): A single row in a table.
- Primary Key: A unique identifier for records in a table.
- Foreign Key: A field linking to a primary key in another table, ensuring referential integrity.
Entity-Relationship (E-R) Diagrams
An E-R diagram represents entities (tables) and their relationships, often illustrating:
- Entities: Represent tables in the database.
- Attributes: Represent columns in the table.
- Relationships: Show how entities relate to each other, often with cardinality notations (e.g., one-to-many).
Normalisation Process
Normalization organizes data to reduce redundancy and improve integrity, typically through steps:
- First Normal Form (1NF): Ensures data is atomic, with each field containing a single value.
- Second Normal Form (2NF): Removes partial dependencies for tables with composite keys.
- Third Normal Form (3NF): Eliminates transitive dependencies, ensuring each attribute depends only on the primary key.


Third Normal Form (3NF) Validation
To determine if a set of tables meets 3NF requirements:
- No Partial Dependencies: For tables with a composite primary key, each attribute depends on the full primary key.
- No Transitive Dependencies: Attributes depend directly on the primary key, not other non-key attributes.
Producing a Normalized Database Design
Based on a data description or tables, one would:
- Identify and correct redundancies.
- Apply normalization steps (1NF to 3NF) to create a design that organizes data logically and consistently.
8.2 Database Management Systems (DBMS)
Features of a DBMS Addressing File-Based Issues
A DBMS provides functions to address the limitations of file-based approaches:
- Data Independence: Separates data storage from application logic.
- Efficient Query Processing: Optimizes retrieval and manipulation of data.
- Transaction Management: Ensures that multiple operations complete successfully together.
- Backup and Recovery: Helps restore data in case of system failures.
- Access Control: Manages permissions for users at various levels of access.
Practical Use of DBMS Tools
Common DBMS tools and their uses:
- Query Tools: Simplify data retrieval with SQL.
- Form and Report Generators: Provide user-friendly data input and output interfaces.
- Backup Utilities: Automate data backup and restore processes.
- Security Management Tools: Help assign roles and permissions to protect data.
8.3 Data Definition Language (DDL) and Data Manipulation Language (DML)
DDL and DML in DBMS
- DDL (Data Definition Language): Manages database structure with statements like
CREATE,ALTER, andDROP.
- DML (Data Manipulation Language): Manages data within tables using commands like
SELECT,INSERT,UPDATE, andDELETE.
SQL as the Industry Standard
Structured Query Language (SQL) is the standard for both DDL and DML, widely used across various DBMSs for consistency and compatibility.
Writing Basic SQL (DDL) Statements
Examples:
- Create Table:
CREATE TABLE Student (StudentID INT, Name VARCHAR(50), Age INT);
- Alter Table:
ALTER TABLE Student ADD Address VARCHAR(100);
- Drop Table:
DROP TABLE Student;
Writing SQL Scripts to Query or Modify Data (DML)
- Select Query:
SELECT Name, Age FROM Student WHERE Age > 18;
- Insert Data:
INSERT INTO Student (StudentID, Name, Age) VALUES (1, 'Alice', 20);
- Update Data:
UPDATE Student SET Age = 21 WHERE StudentID = 1;
This comprehensive foundation covers the fundamental concepts, terminology, and practical applications in databases essential for the CIE Computer Science exam.
- 作者:NotionNext
- 链接:https://tangly1024.com/article/databasea
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章









