How does a relational database organise data into tables, and what does normalising to third normal form achieve?
The relational database model: entities, attributes, primary and foreign keys, entity relationships, the difference between a flat file and a relational database, and normalisation to first, second and third normal form.
An OCR H446 answer on relational databases and normalisation: entities, attributes, primary and foreign keys, entity relationships, the difference between flat-file and relational databases, and how to normalise data to first, second and third normal form.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
OCR wants the building blocks of a relational database (entities, attributes, primary and foreign keys, relationships), the contrast with a flat file, and the ability to normalise data to first, second and third normal form. Expect a "problems of a flat file" discussion and a "normalise this data" task.
The answer
Entities, attributes and keys
Relationships and flat files
Normalisation
Examples in context
A school management system separates Student, Class and Teacher tables linked by keys, so a teacher's name is stored once. An online shop normalises customers, orders, order lines and products, so changing a product's name updates one row. Normalisation underpins referential integrity and efficient SQL joins. OCR pairs this with SQL (querying the linked tables) and with transaction processing (keeping the normalised data consistent under concurrent access).
Try this
Q1. State two problems caused by storing data in a single flat-file table. [2 marks]
- Cue. Any two of: data redundancy, update anomaly, insertion anomaly, deletion anomaly.
Q2. Explain how a many-to-many relationship is implemented in a relational database. [2 marks]
- Cue. With a link (junction) table containing the primary keys of both entities as foreign keys, often forming a composite primary key.
Q3. State the condition a table must meet to be in third normal form, beyond being in 2NF. [1 mark]
- Cue. No non-key attribute depends on another non-key attribute (no transitive dependency).
Exam-style practice questions
Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
OCR 20208 marksA flat-file database stores, in one table, each student's details repeated alongside every club they belong to. Explain the problems this causes and how normalisation to third normal form would resolve them.Show worked answer →
Levels-of-response question; reward problems plus the normalised design.
Problems with the flat file: data redundancy (a student's details are repeated for each club), which wastes space and risks update anomalies (changing an address means editing many rows, and missing one creates inconsistency), insertion anomalies (cannot record a club with no members easily) and deletion anomalies (removing a student's last club loses the student).
Normalisation to 3NF: split into separate tables, for example Student (StudentID primary key, name, address), Club (ClubID primary key, club name) and a Membership table (StudentID and ClubID as foreign keys, together the composite key) to resolve the many-to-many relationship. Each non-key attribute now depends only on its table's whole key and on nothing but the key, removing the repetition and the anomalies.
Top marks need at least two named anomalies and a correct three-table design with the link table resolving the many-to-many.
OCR 20224 marksDefine the terms primary key and foreign key, and explain how they are used to link two tables in a relational database.Show worked answer →
Primary key (1): an attribute (or set of attributes) that uniquely identifies each record in a table, with no duplicates and no nulls.
Foreign key (1): an attribute in one table that is the primary key of another table, used to create a relationship between them.
Linking (2): the foreign key in the "many" table holds the value of the primary key in the "one" table, so each record can be matched to its related record (for example Order.CustomerID is a foreign key referencing Customer.CustomerID, linking each order to its customer). Markers reward "uniquely identifies", "primary key of another table", and a correct description of the link.
Related dot points
- Compression (lossy and lossless, run length encoding and dictionary coding), encryption (symmetric and asymmetric) and hashing, including their characteristics, differences and appropriate uses.
An OCR H446 answer on compression, encryption and hashing: lossy versus lossless compression with run length encoding and dictionary coding, symmetric versus asymmetric encryption, and how hashing works, with the characteristics, differences and appropriate uses of each.
- Structured Query Language (SQL): defining tables, and using SELECT, FROM, WHERE, ORDER BY, INSERT INTO, UPDATE, DELETE and joining tables to query and maintain a relational database, with referential integrity.
An OCR H446 answer on Structured Query Language: defining tables and using SELECT, FROM, WHERE, ORDER BY, INSERT INTO, UPDATE and DELETE, joining tables across a relationship, and the role of referential integrity in a relational database.
- Transaction processing and the ACID properties (atomicity, consistency, isolation, durability), record locking and serialisation to manage concurrent access, and redundancy through commitment ordering and backups.
An OCR H446 answer on transaction processing and managing concurrent access: the ACID properties (atomicity, consistency, isolation, durability), record locking and serialisation to prevent conflicting updates, and redundancy through commitment ordering and backups.
- Data structures: arrays, records, tuples and lists, the stack and queue abstract data types and their operations, linked lists, trees and graphs, and hash tables, including how each is used and its advantages.
An OCR H446 answer on data structures: arrays, records, tuples and lists, the stack and queue abstract data types with their operations, linked lists, trees, graphs and hash tables, including how each is used and its advantages and disadvantages.
- The structure of the internet, the Domain Name System (DNS), URLs and IP and MAC addressing, the difference between the internet and the world wide web, and the protocols HTTP, HTTPS, FTP and the client-server model of the web.
An OCR H446 answer on the structure of the internet: the Domain Name System, URLs, IP and MAC addressing, the distinction between the internet and the world wide web, and the protocols HTTP, HTTPS and FTP within the client-server model of the web.