City University of Hong Kong · FACULTY OF INFORMATION TECHNOLOGY

IS5413 Chap.7 Functional Dependencies and Normal Forms

- one subject, every graph, every model, every mark
7 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 11 · IS5413

Functional Dependencies and Normal Forms

The dependency set is the deliverable, not the working

A functional dependency holds when knowing one attribute, called the determinant, settles what another must be. Normalisation is defined by the course as the process of decomposing relations that show anomalies into smaller well structured relations, and its entire input is the dependency set.

This is the step candidates skip, and skipping it is precisely why the decomposition that follows has to be guessed.

The published course objectives name analysing functional dependencies as a goal in its own right, the design question asks for them as a separate deliverable, and the group project brief requires them to be shown in the relations before third normal form can be demonstrated.

Anomalies are the symptom; dependencies are the cause

A well structured relation is one with minimal redundancy in which rows can be inserted, deleted and updated without creating inconsistencies.

Three named anomalies show the definition being broken. An insertion anomaly means a new fact cannot be recorded without inventing an unrelated one. A deletion anomaly means removing one fact silently destroys another. A modification anomaly means one real world change has to be written to many rows.

All three have the same root cause, which the course states plainly: the table covers more than one theme, so an unnecessary dependency exists between things that are not really connected.

Anomalies are how you notice there is a problem; the dependencies are what tell you where to cut.

The ladder, and the shortcut that saves time

First normal form requires no multivalued attributes and atomic values, and every relation is already in it by definition. Second normal form adds that each non key attribute depends on the key as a whole rather than on a piece of it.

Third normal form adds that no transitive dependency remains, meaning no non key attribute determines another non key attribute. The shortcut worth remembering is that partial dependencies require a composite key to exist at all: a relation in first normal form with a single attribute key is automatically in second normal form.

Transitive dependencies can appear under any key, so a relation with a tidy single column key still has to be checked. Beyond third normal form sit Boyce Codd, fourth and fifth, and the course states that third is generally considered sufficient.

What a decomposition must preserve

Each split should be reported with the dependency that forced it, because that sentence is what makes the answer checkable.

The other thing to watch is the join back. When a non key determinant moves out to become the key of a new relation, it stays behind in the original as a foreign key; dropping it instead loses the ability to reconstruct the original row, which is data loss rather than normalisation.

Finally, normalisation and physical design pull in opposite directions on purpose: normalise fully at the logical level so that the correct structure is known, then denormalise specific relations at the physical level with a stated reason and a known cost.

In this chapter

What this chapter covers

  • 01

    Determinants and the dependency set

  • 02

    Insertion, deletion and modification anomalies

  • 03

    Partial dependencies and why they need a composite key

  • 04

    Transitive dependencies under any key

  • 05

    First, second and third normal form

  • 06

    Reporting the dependency that forced each split

  • 07

    Why the determinant stays behind as a foreign key

Worked example · free

Produce the dependency set, then the decomposition

Q [12 marks]. AskSia authored practice. A driving school holds one relation about lessons: learner number, instructor number, lesson date, learner name, learner suburb, suburb council, instructor name and instructor vehicle. A learner may take many lessons with the same instructor on different dates. Give the primary key, the full dependency set, the normal form the relation is in, and the relations that result from taking it to third normal form. The marks shown here are a study allocation and are not the University's published marking scheme.
A dispensing record with three faults.A dispensing record with three faults. Two arrows leave half of the composite key and one leaves a non key attribute, which is precisely what the next two normal forms remove.patient iddrug codequantitypatient namepatient wardward managerdrug nameunit costpartial, from half the keypartial, from the other halftransitive, key to ward to managerblue boxes are the composite primary key
A dispensing record with three faults. Two arrows leave half of the composite key and one leaves a non key attribute, which is precisely what the next two normal forms remove.
  • 2State the primary key and justify it from the narrative.
  • 4Write every functional dependency with the determinant on the left.
  • 2Name the normal form and the dependency type that caps it.
  • 4Give the resulting relations and name the dependency that forced each split.
The key is learner number, instructor number and lesson date together, because the same learner and instructor can meet on different days. The dependencies are: the three part key determines nothing beyond the fact of the lesson; learner number determines learner name and learner suburb; instructor number determines instructor name and instructor vehicle; and learner suburb determines suburb council. The relation is in first normal form only, capped by two partial dependencies that each use part of the composite key. Removing them gives a learner relation keyed on learner number and an instructor relation keyed on instructor number, leaving a lesson relation keyed on all three original attributes. The learner relation still carries suburb determining council, a transitive dependency, so a suburb relation keyed on suburb is split out with council, and suburb stays behind in learner as a foreign key. Four relations, all in third normal form.
Sia tip — Write each dependency on its own line with the determinant first, and never write the key on the left of a line that also has attributes the key does not actually fix.
Glossary

Key terms

Functional Dependency
A constraint under which knowing one attribute, the determinant, settles another. Written with the determinant on the left of the arrow.
Determinant
The attribute or combination of attributes on the left of a functional dependency, whose value settles the value on the right.
Partial Dependency
A dependency in which a non key attribute is determined by only part of a composite primary key. It cannot exist where the key is a single attribute.
Transitive Dependency
A dependency in which a non key attribute determines another non key attribute, so that the key fixes the first which fixes the second.
Insertion Anomaly
The situation in which a new fact cannot be recorded without supplying an unrelated one, because two themes share a single relation.
Well Structured Relation
A relation with minimal redundancy in which rows can be inserted, deleted and updated without producing inconsistencies.
Boyce Codd Normal Form
The level above third normal form, which removes the anomalies that remain when a relation has several overlapping candidate keys.
FAQ

Functional Dependencies and Normal Forms FAQ

How do I know when to stop normalising?

The course states that third normal form is generally considered sufficient, and the group project brief asks for third normal form specifically. Boyce Codd, fourth and fifth normal form exist above it and address anomalies arising from multiple candidate keys and from multivalued dependencies. Unless a question supplies a reason to go further, reaching third normal form and saying that you have is the complete answer.

Why is my relation already in second normal form?

Most likely because its primary key is a single attribute. A partial dependency is by definition a dependency on part of the key, so a key with no parts cannot have one, and a relation in first normal form with a simple key is in second normal form automatically. Saying that explicitly is worth a mark, because it demonstrates that you know why rather than merely that.

What is the most common way to lose marks on a normalisation question?

Writing the dependency set as a restatement of the schema, with the key on the left and every other attribute on the right. That hides exactly the partial dependencies the question is about and makes the decomposition unverifiable. The next two are splitting without naming the dependency that forced the split, and dropping the determinant from the original relation after moving it, which loses the join back.

Study strategy

Exam move

Take five relations from any source and do only the dependency set for each, on paper, before deciding a normal form. Then decide the form and write one sentence per split naming the dependency responsible. Finish with the check that catches almost everything: read each non key column in turn and ask what determines it, because if the answer is another non key column the relation is not yet in third normal form.

Working through Functional Dependencies and Normal Forms in IS5413? Sia is AskSia’s AI Information Technology tutor — ask any IS5413 Functional Dependencies and Normal Forms question and get a clear, step-by-step explanation grounded in how IS5413 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 16 of your City University of Hong Kong subjects - and 1,000+ Bibles across every Australian university.
Sia - your IS5413 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works