Relational databases — AQA GCSE Computer Science
Verified courseTeaching note checked against the official specification.
A relational database stores data across multiple linked tables containing records and fields, using primary and foreign keys to establish relationships. This structure minimizes data redundancy, preserves referential integrity, and enables precise data querying via SQL.
Relational databases explained
In a relational database, a field is one column of a table that stores a single attribute for every record, such as CustomerID, Surname or Email.
Read the full explanation
Each field has a defined data type and holds one piece of information about the entity. Within a single record, one field holds one value, for example the surname 'Patel'. A field is not the whole row (that is a record) and not the whole table. Fields define the structure of a table: every record in the table has the same set of fields. A field can also be a key, such as a primary key that uniquely identifies each record. Recognising a field as one attribute column is the skill tested here.
Your focus
- Identify a field as a single attribute column in a table.
- Distinguish a field from a record and from a table.
- Explain how a field has a data type and can act as a key.
Which command word is this?
Name or select a specific database component, field, or key from the given stimulus without providing an explanation.
Relational databases exam tips
Topic Overview
A relational database organizes data into one or more structured tables (relations) made up of rows (records) and columns (fields). Rather than storing all information in a single, error-prone flat file, data is logically separated into distinct entities connected by primary and foreign keys.
In AQA GCSE Computer Science, understanding relational databases is essential for Paper 2. Students must be able to define key terms, interpret entity relationships, explain the benefits of relational structures over flat files, and write simple SQL queries to retrieve and manipulate stored data.
Key Concepts
- →Entity, Record, and Field: An entity is a real-world object or concept being modelled; a record is an individual row representing one instance of an entity; a field is an individual column representing a specific attribute.
- →Primary Key: A field that uniquely identifies every record within a table, preventing ambiguity and duplicate entity entries.
- →Foreign Key: A field in one table that links directly to the primary key in another table to enforce referential integrity between related entities.
- →Data Redundancy and Integrity: Relational architecture reduces the duplication of data (redundancy) and ensures data remains accurate and consistent across all linked tables (integrity).
Marking Points
- A field is a single column in a table storing one attribute.
- Each field has a defined data type, such as text, number or date.
- Every record in a table contains the same set of fields.
- A field can act as a key, for example a primary key that uniquely identifies a record.
- A field is not the whole row (a record) nor the whole table.
Examiner Tips
- 💡Look for the word 'column' or 'attribute' when identifying a field in a table diagram.
- 💡Check the data type of a field to confirm it stores one kind of value.
- 💡Eliminate options describing a whole row, because those describe a record, not a field.
- 💡Always reference field and table names exactly as they are printed in the exam question, preserving capitalisation and spelling.
- 💡When explaining the drawbacks of flat-file databases, explicitly reference 'update anomalies' (inconsistent updates) and 'data redundancy' to access the top mark band.
- 💡Memorise the exact syntax sequence for SQL: SELECT (fields), FROM (tables), WHERE (conditions/joins), and ORDER BY (sorting).
Common Mistakes
- Confusing a field with a record: a field is one attribute column, whereas a record is a whole row of fields.
- Thinking a field holds all the data about an entity; it holds only one attribute of that entity.
- Assuming fields can vary between records in the same table; all records share the same field structure.
- Misconception: Foreign keys must share the exact same column name as the primary key they reference. Correction: While it is standard practice to name them identically for clarity, the database requires matching data types and valid references, not identical names.
- Misconception: A primary key must always consist of just a single field. Correction: A primary key can be a composite key made up of two or more fields that together form a unique identifier for a record.
- Misconception: Relational databases eliminate all duplicate data entirely. Correction: Relational databases eliminate unnecessary data duplication (redundancy), but key fields (foreign keys) must still be repeated to establish the relationships.
Revision Plan
- 1Day 1-2: Master core vocabulary by drawing and labelling a two-table relational schema with fields, records, primary keys, and foreign keys.
- 2Day 3-4: Practice identifying anomalies (insertion, deletion, update) in unnormalised flat-file spreadsheets to appreciate the benefits of relational tables.
- 3Day 5-6: Write and test fundamental SQL statements (SELECT, FROM, WHERE, ORDER BY) incorporating single-table queries and simple relational joins.
- 4Day 7: Complete timed AQA past-paper questions focusing on database structure design and key identification.
Exam Question Types
- 📋Key Identification Questions: Identifying primary keys, foreign keys, or suitable data types from a provided table schema.
- 📋Comparison Questions: Comparing flat-file databases to relational databases in terms of efficiency, integrity, and storage.
- 📋SQL Query Writing: Constructing valid SQL commands using SELECT, FROM, WHERE, and ORDER BY across one or two related tables.
Command Word Expectations (AQA)
Name or select a specific database component, field, or key from the given stimulus without providing an explanation.
State a valid point about relational database behaviour or structure and expand upon it with an explanation of its cause, mechanism, or consequence.
Provide a brief, factual answer without calculation, elaboration, or justification.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A school database tracks Students and Clubs. Each student can join one Club, and each Club has multiple students. Table: Student(StudentID, FirstName, LastName, DateOfBirth, ClubID) Table: Club(ClubID, ClubName, RoomNumber) (a) Identify the primary key for the Student table. (b) Identify the foreign key in this design and explain its purpose.
- 1.Step 1: Examine the Student table attributes to find the attribute that uniquely identifies each student entity. StudentID is the unique identifier, making it the primary key.
- 2.Step 2: Look for an attribute present in the Student table that also acts as a primary key in another table. ClubID exists in both tables.
- 3.Step 3: State the attribute and describe its relational role: ClubID in the Student table acts as a foreign key that references ClubID in the Club table to link a student to their specific club.
Question: A doctor's surgery uses a relational database with two tables: Patient(PatientID, FullName, Postcode) Appointment(AppointmentID, Date, Time, Fee, PatientID) Write an SQL statement to retrieve the FullName of all patients who have an appointment with a Fee greater than 50.00.
- 1.Step 1: Identify the required fields for display. The question requests FullName, which comes from the Patient table.
- 2.Step 2: Identify the tables involved. Both Patient and Appointment are needed to match patients with appointment fees.
- 3.Step 3: Define the JOIN condition linking the primary key of Patient (Patient.PatientID) with the foreign key of Appointment (Appointment.PatientID).
- 4.Step 4: Formulate the WHERE clause filter to restrict records where Fee > 50.00.