Spec & Goals 3 min
AQA Spec 3.7.1 — The concept of a database; the flat-file problem; data redundancy
By the end of this lesson you can:
- Define a database and a flat file.
- Explain the problems of data redundancy and inconsistency.
- State why a relational database is usually a better solution.
Warm-Up 5 min
Unit 6 ended with protecting data. But how is data organised in the first place? Almost every app — a school register, a kedai till, a library — is built on a database.
Quick starter
A library keeps one big spreadsheet. Every time Aisyah borrows a book, her full name, form and address are typed again. What could go wrong?
Reveal the idea
Her details are repeated on every row (wasteful) and might be typed differently each time (inconsistent). That's the flat-file problem.
Key Concept — storing data well 14 min
A database is an organised, persistent collection of data, stored so it can be searched, updated and retrieved easily.
A flat-file database
A flat file stores everything in a single table. It is simple, but repeats data. Here a library keeps loans in one table:
| Member | Form | Town | Book | Due |
|---|---|---|---|---|
| Aisyah | 10A | Ipoh | Hatching Twitter | 12 Jun |
| Aisyah | 10A | Ipoh | Sapiens | 14 Jun |
| Wei Jie | 10B | Penang | Dune | 13 Jun |
Two problems this causes
| Problem | What it means |
|---|---|
| Data redundancy | The same data is stored more than once (Aisyah's form and town repeat on every loan). |
| Data inconsistency | Repeated copies can disagree — one row says "Ipoh", another "ipoh" or "Ipoh". Update one and miss the rest. |
Worked Example — spot the redundancy 12 min
Problem: A canteen records every sale in one flat file. Identify the redundancy and the risk it creates.
| Student | Class | Item | Price (RM) |
|---|---|---|---|
| Priya | 10A | Nasi lemak | 3.50 |
| Priya | 10A | Milo | 2.00 |
| Priya | 10A | Nasi lemak | 3.50 |
- Redundancy: Priya's class ("10A") is stored on every row; the price of "Nasi lemak" is repeated.
- Risk: if Priya changes class, you must edit every row — miss one and the data is inconsistent. If the nasi lemak price rises, the same problem occurs.
- Better: a relational design — a Student table and a Product table — each fact stored once, linked by keys.
Try It Yourself 12 min
Goal: Define database and flat file.
Goal: Explain the difference between data redundancy and data inconsistency.
Goal: A sports club keeps members and their bookings in one flat file. Give two examples of redundancy and the problem each causes.
📝 Exam Practice 10 min
Define the term data redundancy.
Mark scheme
- Unnecessarily storing the same data in more than one place (1).
Explain how storing data in a flat file can lead to inconsistent data.
Mark scheme
- The same data is repeated on many rows (redundancy) (1).
- If one copy is updated and others are not, the copies disagree / become inconsistent (1).
State one advantage of a relational database over a flat-file database.
Mark scheme
- Reduces data redundancy / reduces inconsistency / data stored once / easier to update (any one) (1).
Recap & Key Terms 3 min
A database organises data for easy search and update. A flat file uses one table and repeats data, causing redundancy (data stored more than once) and inconsistency (copies that disagree). A relational database fixes this by storing each fact once across linked tables.
- Database
- An organised, persistent collection of data that can be searched and updated.
- Flat-file database
- A database holding all data in a single table.
- Data redundancy
- Unnecessarily storing the same data in more than one place.
- Data inconsistency
- When repeated copies of data do not match each other.
Homework 1 min
Task (≤ 15 min): Take a flat file of doctor's appointments (patient name, address, doctor, room, time). Identify two pieces of redundant data and explain the inconsistency risk each creates.
Model answer (example)
The patient's address repeats on every appointment — if they move, all rows must be updated or the data becomes inconsistent. The doctor's room repeats — if the doctor changes room, every appointment row must change, risking mismatched values. A relational design (Patient table, Doctor table, Appointment table) stores each fact once.
Award marks for: two redundant items identified (2); a valid inconsistency risk for each (2).