Revision Notes
AQA A-Level Computer Science (7517): Database Design and Normalisation Techniques – Revision Notes
Condensed AQA 7517 section 4.10.3 recall: reasons for normalising, anomalies, functional dependency, first, second and third normal form and a method to apply.
- Subject
- Computer Science
- Level
- A LEVELS
- Topic
- Fundamentals of databases
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to AQA A Level Computer Science (7517), 2015-onwards. Official specification .
Syllabus page (what it covers and how it is assessed): AQA A Level Computer Science.
Syllabus points this page covers
7517
- 4.10.3 Database design and normalisation techniques
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (7517).
Condensed recall for 4.10.3 Database design and normalisation techniques, AQA A-Level Computer Science (7517): normalise relations to third normal form, know the properties of a relation in third normal form, and understand why databases are normalised. Full worked examples are in the normalisation study guide; questions are in the normalisation practice questions.
Why normalise?
- Less redundancy: each fact stored once.
- Consistency: one place to update.
- No anomalies:
- update anomaly: many rows to change, with the risk of missing one;
- insertion anomaly: cannot record a customer or product until an order exists;
- deletion anomaly: deleting the last order loses customer or product details.
- Saves storage and eases maintenance.
- Cost: more tables and joins in queries.
Vocabulary
| Term | Meaning |
|---|---|
| Functional dependency A → B | Each value of A determines exactly one value of B |
| Partial dependency | A non-key attribute depends on only part of a composite key |
| Transitive dependency | A non-key attribute depends on another non-key attribute |
| Repeating group | A set of attributes that occurs several times in one record |
| Atomic value | A single, indivisible value in a cell |
The normal forms
| Form | Requirements |
|---|---|
| 1NF | No repeating groups; every cell holds one atomic value; has a primary key |
| 2NF | In 1NF, and no partial dependencies (every non-key attribute depends on the whole key) |
| 3NF | In 2NF, and no transitive dependencies (no non-key attribute depends on another non-key attribute) |
Memory line: every non-key attribute depends on the key, the whole key, and nothing but the key.
A table in 1NF whose key is a single attribute is already in 2NF.
Method
- 1NF: one row per repeating item; choose a primary key (composite if needed).
- 2NF: write the dependencies; for each attribute that depends on only part of the key, move it to a new table whose key is that part.
- 3NF: for each non-key attribute that depends on another non-key attribute, move both to a new table keyed by the determining attribute; keep that attribute as a foreign key.
- Mark primary and foreign keys in every final table.
- Check that joining the tables rebuilds the original data.
Worked recall: orders
Order form: OrderNo, OrderDate, CustomerID, CustomerName, CustomerAddress, plus products (code, name, price, quantity).
- 1NF: one row per product line; key (OrderNo, ProductCode).
- 2NF: OrderNo determines date and customer details; ProductCode determines name and price; the pair determines quantity. Split into Order, Product, OrderLine.
- 3NF: CustomerID determines CustomerName and CustomerAddress, so move them to Customer.
Result:
Customer (CustomerID, CustomerName, CustomerAddress)Order (OrderNo, OrderDate, CustomerID)Product (ProductCode, ProductName, UnitPrice)OrderLine (OrderNo, ProductCode, Quantity)
Worked recall: clinic
Appointment (AppointmentID, AppointmentDate, PatientID, PatientName, DoctorID, DoctorName) has a single-attribute key, so 2NF is automatic. PatientID determines PatientName, and DoctorID determines DoctorName, so these are transitive dependencies.
Appointment (AppointmentID, AppointmentDate, PatientID, DoctorID)Patient (PatientID, PatientName)Doctor (DoctorID, DoctorName)
Identifying the problem
| Symptom in the data | Break in |
|---|---|
| A cell holds “P1, P2” or columns Item1, Item2 | 1NF |
| Attribute depends on part of a composite key | 2NF |
| Attribute fixed by another non-key attribute (name fixed by ID) | 3NF |
Key terms
| Term | Definition |
|---|---|
| Normalisation | Organising data into tables so that each fact is stored once |
| Redundancy | The same data stored in more than one place |
| Anomaly | An error or inconsistency caused by redundancy when data is changed |
| Determinant | An attribute that determines the value of another |
| Composite key | A key made of more than one attribute |
| Foreign key | An attribute that is the primary key of another table |
| Decomposition | Splitting a table into smaller tables without losing data |
Exam traps
- 1NF means more than having a key: remove repeating groups too.
- Partial dependencies exist only with composite keys.
- Keep the linking key as a foreign key in the original table.
- Do not lose data when splitting.
- Mark every key in the final answer.
- Normalisation is about redundancy and anomalies, not speed.
- Give a data example when explaining an anomaly.
Self-test
- State two requirements of first normal form.
- What is a partial dependency?
- State the extra requirement of 3NF beyond 2NF.
- What is a transitive dependency?
- Give one update anomaly.
- Give one deletion anomaly.
- Why does a table with a single-attribute key need no 2NF work?
- A table has columns Phone1, Phone2 and Phone3. Which normal form does it break?
- In
Order (OrderNo, CustomerID, CustomerName)what should be moved? - What must remain in the original table when attributes are moved?
- Give one benefit of normalising.
- Give one cost of normalising.
Answers
- No repeating groups; each cell holds a single value; a primary key exists.
- A non-key attribute that depends on only part of a composite primary key.
- No transitive dependencies: non-key attributes depend only on the key.
- A non-key attribute that depends on another non-key attribute.
- For example, a customer’s address held in many rows must be changed in every one; missing one leaves inconsistent data.
- For example, deleting the only order for a customer also deletes the customer’s details.
- There is no part of the key for an attribute to depend on, so no partial dependency.
- First normal form (repeating group).
- CustomerName, to a Customer table keyed by CustomerID.
- The key attribute (CustomerID) as a foreign key.
- Less redundancy, consistency, or no anomalies.
- More tables, so queries need joins.
More resources on this topic
Related resources
-
Study guides
AQA A-Level Computer Science (7517): Relational Databases
Deeper guide to AQA 7517 section 4.10.2: the relational database concept, tables, attributes, primary keys, composite primary keys, foreign keys and referential integrity.
Computer Science · AQA · A Level
Read guide -
Practice questions
AQA A-Level Computer Science (7517): Relational Databases – Practice Questions
Original AQA 7517 section 4.10.2 questions with answers: defining attributes and keys, spotting primary, composite and foreign keys, and referential integrity.
Computer Science · AQA · A Level
Try questions -
Revision notes
AQA A-Level Computer Science (7517): Relational Databases – Revision Notes
Condensed AQA 7517 section 4.10.2 recall: the relational database concept, attribute, primary key, composite primary key, foreign key and referential integrity.
Computer Science · AQA · A Level
Revise topic
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.