Skip to content
SPM Tuition
Computer Science · Database development

Normalising a small data set

You memorised the normal forms, but splitting a real table still feels like guessing.

Normalising splits a table so each fact is stored once. Work through the problems in order: repeating groups, then partial dependencies, then dependencies between non-key columns.

This lesson opens database development. The reasons behind it are in explaining update anomalies.

Worked example: a sports day register

The starting table is original.

StudentID StudentName House HouseTeacher Event1 Event2
S01 Aina Merah Puan Lim 100m Relay
S02 Bala Biru Encik Raj Relay
S03 Chen Merah Puan Lim 200m 100m

Step 1: remove repeating groups. Event1 and Event2 repeat the same kind of fact. Move events into their own table, one row per student and event.

Entry

StudentID Event
S01 100m
S01 Relay
S02 Relay
S03 200m
S03 100m

The key of Entry is the pair (StudentID, Event).

Step 2: check for partial dependencies. Student has a single-column key, StudentID, so no column depends on only part of the key.

Step 3: remove dependencies between non-key columns. HouseTeacher depends on House, not on StudentID. Move it out.

Student

StudentID StudentName House
S01 Aina Merah
S02 Bala Biru
S03 Chen Merah

House

House HouseTeacher
Merah Puan Lim
Biru Encik Raj

Now Puan Lim is stored once. Student.House is a foreign key to House.

The mistake that costs marks

Some students split a table by copying columns into new tables without a key linking them. The pieces cannot be joined back.

Split Can you rebuild the original?
Student, House and Entry with StudentID and House as keys yes
a table of names, a table of houses, no link between them no, you cannot tell whose house is whose

The fix is to keep a foreign key in every child table, then test the rebuild.

Check yourself

A table has OrderID, Customer, CustomerPhone and Item1, Item2. List the two problems and the new tables.

Answer

Problem 1: Item1 and Item2 are a repeating group, so move items to OrderItem (OrderID, Item). Problem 2: CustomerPhone depends on Customer, not on OrderID, so move it to Customer (Customer, CustomerPhone). Order keeps OrderID and Customer as a foreign key.

What to study next

Split tables must be joined again to answer questions. Continue with joining related tables, then try the database development practice set.

If you want a teacher to go through your normalising steps, see online one-to-one Computer Science tuition.

Common questions

What are the first three normal forms in simple words?

First normal form: every cell holds one value and there are no repeating columns. Second normal form: every non-key column depends on the whole key. Third normal form: no non-key column depends on another non-key column. Check your course scope for how far you must go.

How do I start normalising?

Pick a primary key for the table, then look for repeated groups, then for facts that belong to only part of the key, then for facts that depend on other non-key columns. Fix them in that order.

How do I know the split is correct?

Join the new tables back together and check that you recover the original facts with no loss and no invented rows. If a fact disappears or appears twice, the split is wrong.

If normalisation questions feel hard, one-to-one Computer Science lessons let a teacher hand you a messy table and coach each splitting decision.

  • Online one-to-one lessons for your child with an experienced teacher.
  • Your first class is a one-hour trial, from RM50. The fee is agreed before you book.
  • Happy with the teacher? Continue with lessons of about 1.5 hours. If not, ask for another teacher.