Decomposition into Third Normal Form (3NF)

Chris picture Chris · Dec 6, 2010 · Viewed 28.3k times · Source
Scheme (R) = (A,B,C,D,E,F,G,H)

Function Dependencies (F) = {A->CGH, AD->C, DE->F, G->H}

How would I perform a lossless-join decomposition of the schema R into Third Normal Form (3NF)?

Any help will be appreciated.

Answer

Jonathan Leffler picture Jonathan Leffler · Dec 6, 2010

Since A→CGH and Ax→C for any letter x, we can ignore the second of the functional dependencies (AD→C) because it doesn't tell us anything that A→CGH doesn't also tell us.

There is nothing that determines B; there is nothing that determines D.

Since G determines H, and A determines both G and H, we can separate G→H into a relation (there is a transitive dependency A→G and G→H).

R1 = { G, H }       : PK = { G }

That leaves F' = { A→CG, DE→F } and R' = (A, B, C, D, E, F, G).

The two functional dependencies left can form two more relations:

R2 = { A, C, G }    : PK = { A }
R3 = { D, E, F }    : PK = { D, E }

That leaves R'' = { A, B, D, E }

R4 = { A, B, D, E } : PK = { A, B, D, E }

The join of R1, R2, R3, and R4 should leave you with the R you started with for any starting value of R (that satisfies the constraints of the given functional dependencies).