LightMySky

Functional Dependencies and Boyce-Codd Normal Form

A functional dependency says one set of attributes fixes another. Computing the closure of a set of dependencies finds the candidate keys, and Boyce-Codd normal form is the condition that every dependency starts from one of those keys.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • List the functional dependencies of a table and compute the closure of an attribute set
  • Find all candidate keys from a set of dependencies
  • Decompose a table that violates Boyce-Codd form and check the join still recovers it

1 · Read

A functional dependency says one set of columns fixes another. If every student has one email, then student ID fixes email, written ID -> email. The left side decides, so two rows with the same left side can never show different right sides.

To find what a set of columns can reach, compute its closure. Start with the columns you have, apply every dependency again and again, and collect each new column you reach. If the closure reaches every column of the table, you started with a candidate key, a smallest set that names each row alone.

Try it together

Take a table of student, email, and dorm with ID -> email and email -> dorm. The closure of ID reaches email, then dorm, so ID is a candidate key. But email -> dorm starts from email, which alone cannot name a row, so this table breaks Boyce-Codd form. Split it on the violating rule: one table holds ID with email, the other holds email with dorm.

Good to know

A rule that starts outside a key stores one fact many times, and later updates can make the copies disagree. That is why each fact deserves exactly one home. After you split, join the pieces back and check that you recover the rows you started with.

Dependencies show which columns fix which, closures reveal the keys, and every rule must start from a key or the table splits.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Functional Dependencies and Boyce-Codd Normal Form · Computing, ages 18 to 19 · LightMySky