Show understanding of, and correctly use, the terminology associated with a relational database model (AO1). Analyse a given schema, design tables that satisfy the required relationships, and write basic SQL statements to create, query and modify those tables (AO2 & AO3).
| Term | Definition |
|---|---|
| Database | An organised collection of data stored electronically and accessed by a computer system. |
| Relational Database Management System (RDBMS) | Software that creates, maintains and provides controlled access to a relational database (e.g. MySQL, PostgreSQL, Microsoft SQL Server). |
| Table (Relation) | A set of rows (records) and columns (attributes) that stores data about a single entity. |
| Row (Tuple, Record) | A single, complete set of related data items in a table. |
| Column (Attribute, Field) | A named data item that holds a particular type of information for all rows. |
| Domain | The set of all possible values that an attribute may take (e.g. INTEGER, VARCHAR(50)). |
| Primary Key (PK) | A column, or minimal set of columns, that uniquely identifies each row in a table. |
| Foreign Key (FK) | A column (or set of columns) that references the primary key of another table, thereby creating a link between the two tables. |
| Relationship | The logical connection between two tables. Cambridge requires knowledge of the three cardinalities:
|
| Referential Integrity | The rule that a foreign‑key value must either be null or match an existing primary‑key value in the referenced table. |
| Normalization | The systematic process of organising tables to reduce redundancy and improve data integrity. Cambridge expects understanding of 1NF, 2NF and 3NF. |
| SQL (Structured Query Language) | The standard language used to define, query and manipulate relational data. |
A relational table can be expressed mathematically as a set of ordered n‑tuples:
\[ R = \{ (a_1, a_2, \dots , a_n) \mid a_i \in D_i \} \]Each cell therefore contains a single, atomic value – the “atomicity” requirement of First Normal Form (1NF).
Figure 1 (placeholder) shows an ER diagram with two entities, Student and Enrollment, linked by a one‑to‑many relationship (a student can enrol in many courses).
| StudentID (PK) | Name | |
|---|---|---|
| 1001 | Alice Brown | alice@example.com |
| 1002 | Bob Smith | bob@example.com |
| 1003 | Charlie Davis | charlie@example.com |
| EnrollID (PK) | StudentID (FK) | CourseCode | Semester |
|---|---|---|---|
| 2001 | 1001 | CS101 | Fall 2025 |
| 2002 | 1002 | CS101 | Fall 2025 |
| 2003 | 1001 | MA102 | Fall 2025 |
StudentID resides on the “many” side (Enrollments).StudentCourse(StudentID FK, CourseCode FK).Start with an un‑normalised table that mixes student data, course details and lecturer names.
| StudentID | Name | CourseCode | CourseTitle | Lecturer |
|---|---|---|---|---|
| 1001 | Alice Brown | CS101 | Intro to CS | Dr Lee |
| 1001 | Alice Brown | MA102 | Calculus II | Prof Khan |
| 1002 | Bob Smith | CS101 | Intro to CS | Dr Lee |
Students(StudentID, Name)StudentCourses(StudentID, CourseCode, CourseTitle, Lecturer)StudentCourses the attributes CourseTitle and Lecturer depend only on CourseCode. Create a separate Courses table:
Courses(CourseCode, CourseTitle, Lecturer)StudentCourses(StudentID, CourseCode)
-- Create the three tables
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Email VARCHAR(100) UNIQUE
);
CREATE TABLE Courses (
CourseCode CHAR(6) PRIMARY KEY,
CourseTitle VARCHAR(100) NOT NULL,
Lecturer VARCHAR(100)
);
CREATE TABLE Enrollments (
EnrollID INT PRIMARY KEY,
StudentID INT NOT NULL,
CourseCode CHAR(6) NOT NULL,
Semester VARCHAR(20),
FOREIGN KEY (StudentID) REFERENCES Students(StudentID),
FOREIGN KEY (CourseCode) REFERENCES Courses(CourseCode)
);
-- INSERT rows
INSERT INTO Students VALUES (1004,'Diana Prince','diana@example.com');
INSERT INTO Courses VALUES ('PH201','Physics II','Dr Miller');
INSERT INTO Enrollments VALUES (2004,1004,'PH201','Spring 2026');
-- UPDATE a value (AO3)
UPDATE Students
SET Email = 'alice.brown@university.edu'
WHERE StudentID = 1001;
-- DELETE a row (AO3)
DELETE FROM Enrollments
WHERE EnrollID = 2002;
-- SELECT examples (AO2)
-- a) Inner join – list all enrolments
SELECT s.Name, c.CourseTitle, e.Semester
FROM Students s
JOIN Enrollments e ON s.StudentID = e.StudentID
JOIN Courses c ON e.CourseCode = c.CourseCode;
-- b) Left outer join – students with no enrolments
SELECT s.Name, e.EnrollID
FROM Students s
LEFT JOIN Enrollments e ON s.StudentID = e.StudentID
WHERE e.EnrollID IS NULL;
| AO | What the notes help you do |
|---|---|
| AO1 | Recall definitions, recognise primary/foreign keys, and describe 1NF‑3NF. |
| AO2 | Analyse a scenario, identify relationships, and decide which normal form a schema satisfies. |
| AO3 | Design tables, write DDL/DML, and modify data while preserving referential integrity. |
SHOW CREATE TABLE (or equivalent).| Checklist Item | Evidence in Notes | Action if Missing |
|---|---|---|
| All key terms (PK, FK, domain, normal forms, etc.) defined in Cambridge wording. | Section 1 – complete table. | Add any omitted term. |
| Formal mathematical definition of a relation. | Section 2 – present. | None. |
| Clear example showing ER diagram, tables, and cardinalities (1:N, M:N). | Section 3 – includes ER placeholder and tables. | Insert a simple ER diagram sketch if possible. |
| Step‑by‑step normalisation from UNF → 1NF → 2NF → 3NF. | Section 4 – detailed. | None. |
| DDL for creating tables, including primary‑key and foreign‑key constraints. | Section 5.1 – present. | None. |
| DML examples covering INSERT, UPDATE, DELETE and SELECT with INNER & LEFT JOIN. | Section 5.2 – present. | None. |
| Mapping of notes to AO1, AO2, AO3. | Section 6 – table provided. | None. |
| Practical exam‑style checklist (test edge cases, comment scripts). | Section 7 – present. | None. |
| Concise “flashcard” summary of the most exam‑relevant points. | Section 8 – present. | None. |
For last‑minute revision, a one‑page PDF containing the terminology table, normalisation steps, and the core SQL commands can be generated from the notes above. Keep it handy during the exam.
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.