A teacher stores student and subject data in a single flat-file table as shown below. StudentID StudentName Subject1 Subject2 Subject3 TeacherName TeacherEm...

Assessment: Computer Science (9-1) 0984 | Paper 2 Mock 01 | Algorithms, Programming and Logic Subject: Computer Science (9-1) - 0984

Question 1 Report

A teacher stores student and subject data in a single flat-file table as shown below.

StudentIDStudentNameSubject1Subject2Subject3TeacherNameTeacherEmail
101K. AdeyemiMathsPhysicsChemistryMr. Jonesjones@school.com
102L. ChenMathsBiologyMr. Jonesjones@school.com
103M. OkaforEnglishHistoryGeographyMs. Smithsmith@school.com

(a) State two problems with this flat-file table design. [2]

(b) The table has separate columns for Subject1, Subject2, and Subject3. Explain why this is a poor design choice and how it should be reorganised. [2]

Answer Details

(a) Two problems with the flat-file table design: [2]

Problem 1: Data redundancy. Teacher details (name and email) are repeated for every student they teach. If Mr. Jones teaches 30 students, his name and email are stored 30 times. This wastes storage space and creates the risk of inconsistency: if his email changes, every row must be updated, and missing even one creates contradictory data (an update anomaly). [1]

Problem 2: The structure limits each student to exactly three subjects. A student taking fewer subjects leaves empty fields (wasted space), and a student taking more than three subjects cannot be accommodated without adding more columns to the table. This inflexible design requires changing the table structure whenever the maximum number of subjects changes. [1]

(b) Why separate Subject columns are poor design and how to fix it: [2]

Having separate Subject1, Subject2, Subject3 columns is called a repeating group. [1] It is a violation of first normal form (1NF) in database design. This structure limits the number of subjects to three and creates empty cells when a student takes fewer subjects. It also makes queries difficult: searching for all students taking "Maths" requires checking three separate columns.

The subjects should be moved to a separate table where each student-subject combination is a separate record. [1] For example:

STUDENT_SUBJECT table:

StudentIDSubject
101Maths
101Physics
101Chemistry
102Maths
102Biology

This design allows any number of subjects per student without altering the table structure, and querying becomes simple: WHERE Subject = 'Maths' finds all students taking Maths in one column.

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning