School Information Management System
Welcome to the central administrative database for St Jude's Academy. Manage student profiles, record GCSE course enrollments, track tutor groups, and inspect behind-the-scenes database storage architectures.
How Does the School Store this Record Behind the Scenes?
Every time a pupil enrolls in another subject, their name, home address, and tutor group are duplicated onto a brand new row. Editing one row without editing every other row produces fatal data conflicts!
| #Row | StudentID | StudentName | Residential Address | Form | Subject | Teacher | Room | Row Actions |
|---|
Primary Key: StudentID. Each student occupies exactly one single row. Updating an address here is atomic and permanentβconflicting addresses are mathematically impossible!
| StudentID PK | StudentName | DOB | Residential Address | Form | Emergency Phone | Enrollments |
|---|
Enrollments.StudentID references Students.StudentID. Notice that Enrollments does NOT duplicate pupil name, address, form, telephone, or staff room data!
Primary Key: EnrollmentID | Foreign Key: StudentID. Each record represents a pupil's subject enrollment and target grade. Removing Teacher & Room keeps this 2-table model fully normalized for GCSE without duplicating staff data.
| EnrollmentID PK | StudentID FK | Subject | Target Grade | Status |
|---|
Live Storage Diagnostics & Real-World Anomaly Testing
Observe how backend storage models behave when records are updated, added, or deleted. Test how flat-file spreadsheets fail compared to normalized relational databases.
Data Redundancy
Unnecessary duplication of data. In a flat-file database, storing pupil addresses 3β5 times consumes extra storage space and slows backups. Relational databases eliminate redundancy by storing personal details strictly once in a parent entity.
The 3 Database Anomalies
β’ Update Anomaly: Changing data in 1 row leaves older data in other rows (inconsistent records).
β’ Deletion Anomaly: Deleting a subject accidentally erases the student's entire profile.
β’ Insertion Anomaly: Cannot record a new subject until a student enrolls onto it.
Primary & Foreign Keys
β’ Primary Key (PK): A field that uniquely identifies each record in its table (e.g. StudentID).
β’ Foreign Key (FK): A primary key from another table used to establish a relationship without repeating full personal details.
Imagine writing a student's full name, address, and form group next to every single exam they ever sit. If Alice takes 10 exams, her details would be repeated 10 times! If she moves house, updating 10 rows risks errors. In a Relational Database, we store student details once in the Students table, and link their exam results using a Foreign Key.
A table holds records (rows) and fields (columns). Separating tables prevents data redundancy (unnecessary duplication).
Primary Key (PK): Unique ID in its own table.
Foreign Key (FK): Links back to the PK of another table to connect records.
SELECT (which columns) β’ FROM (which table)WHERE (filter condition) β’ ORDER BY (sort ASC/DESC)
| StudentID PK | FirstName | LastName | YearGroup | FormGroup |
|---|
| ResultID PK | StudentID FK | Subject | Grade | Score |
|---|
ExamResults.StudentID FK links to Students.StudentID PK (One student can have many exam results).
How the database engine parsed and executed your SQL statement:
Key Exam Traps & Core Concepts
Primary Key vs Foreign Key
Examiners frequently ask for definitions of primary and foreign keys. Be precise with your wording:
β’ A field (or attribute) that uniquely identifies each individual record in a table.
β’ Example:
StudentID in the Students table.
β’ An attribute in one table that is the primary key of another table, used to establish a link/relationship between the two tables.
β’ Example:
ExamResults.StudentID.
Why Split Data into Multiple Tables? (Flat File vs Relational)
A classic 3-mark question: "Explain one advantage of using a relational database rather than a flat-file database."
β’ Prevents Update Inconsistencies: If Alice changes form room, it is updated in one place only (in the Students table), rather than across 10 different exam entries.
β’ Smaller File Size & Faster Queries: Less duplicate text means less storage used.
Quotes Around Strings vs Numbers
In SQL, text and character data types must always be wrapped in single quotes ('Computing' or '11A'). Numeric integers (such as Score >= 80 or YearGroup = 11) must not have quotes.
β Wrong: WHERE Subject = Computing AND Score >= '80'
Exam Style Questions with Mark Schemes
Q1: Define what is meant by a foreign key in a relational database.
Q2: State two reasons why a school would use a relational database with separate Students and ExamResults tables rather than a single flat-file spreadsheet.
Q3: Write an SQL statement to retrieve the subject and score of all exam results from the ExamResults table where the score is greater than 80, ordered by score from highest to lowest.
SELECT Subject, Score FROM ExamResults
WHERE Score > 80
ORDER BY Score DESC