Functional Dependencies and Boyce-Codd Normal Form · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Keys that decide everything

Computing · Data & Databases · ages 18-19
Name ______________________   Date ____________
  1. What is a candidate key?

    • The first column of every table
    • A smallest set of columns that names each row alone
    • Any column that holds numbers
  2. The table rule is student ID -> email. What does it promise?

    • Each ID always pairs with the same email
    • Each email always pairs with the same ID
    • Every student shares a single email
  3. A table is in Boyce-Codd form exactly when every dependency starts from a candidate key.

    Circle one:   True   False

  4. A table holds ID, email, and dorm, with ID -> email and email -> dorm. Which set is a candidate key?

    • {ID}
    • {email}
    • {ID, email}
  5. Columns are A, B, C, with rules A -> B and B -> C. What is the closure of {A}?

    • {A, B}
    • {A}
    • {A, B, C}
  6. Rules are A -> B, B -> C, C -> D. Starting from {A}, how many of the 4 columns does the closure reach?

    Answer: ______________

  7. The rule email -> dorm violates BCNF in a table of ID, email, and dorm. How do you repair the table?

    • Delete the dorm column entirely
    • Add rows until email can name every row
    • Split into ID with email plus email with dorm, then join back to check
  8. Pat claims a table with email -> dorm is in BCNF because email holds no duplicates today. What is wrong?

    • A key must be a single column, never a set
    • A rule is judged by what must hold, and email still cannot name a row
    • BCNF only cares about numeric columns, not emails
LightMySky · lightmysky.comW1-mt_PfWLq1aEQz-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Keys that decide everything W1-mt_PfWLq1aEQz-s1

  1. A smallest set of columns that names each row alone · It is the smallest column set whose closure reaches the whole row.
  2. Each ID always pairs with the same email · The left side decides: repeat an ID and the email repeats too.
  3. True · That starting-from-a-key check is the whole BCNF test.
  4. {ID} · Only ID reaches every column, and no smaller set reaches all three.
  5. {A, B, C} · A reaches B, and B reaches C, so the closure collects all three.
  6. 4 · The chain reaches B, then C, then D, so all 4 columns.
  7. Split into ID with email plus email with dorm, then join back to check · Each fact gets one home, and the join check proves no rows were lost.
  8. A rule is judged by what must hold, and email still cannot name a row · BCNF asks whether the left side can name a row in every allowed state, not whether values happen to differ today.
Worksheet · LightMySky