Assignment:
Consider a relation ??(??,??,??,??,??,??,??) and its FD set ?? = {???? → ????, ?? → ??, ?????? → ????, ?? → ????, ?? → ????, ?????? → ????}.
Decompose it into a collection of BCNF relations if it is not in BCNF. Make sure your decomposition is lossless-join.
Explanation
Hi, I'm working on my database homework (relation design chapter).
I think I've commanded the basic process based on in-class examples.
However, the tricky part here is we have an attribute 'H' which has no relation with others, which confuses me deeply. How should I handle it?
Attempted answer
? We start from a schema:?ABCDEGH, since H has no relations with any attribute, we decompose it into tables: H and ABCDEG
? The FDs for ABCDEG remains the same, therefore key is E.
? The FD?D →AG?violates BCNF (FD with non-key on LHS).
? To fix, we need to decompose into tables:?ADG?and?BCDE
? FDs for?ADG?are?{ D → AG }, therefore key is?D, therefore BCNF.
? FDs for?BCDE?are?{ B → CD,? E → D,? BC → DE, E → B, CD → BE }
? Key for?BCDE?is?also E, and FD?B → CD?violates BCNF (FD with non-key on LHS).
? To fix, we need to decompose into tables:?BCD?and?BE
? FDs for?BCD?are?{ B → CD }?therefore key is B, therefore BCNF.
? FDs for?BE?are?{ E → B }?therefore key is E, therefore BCNF.
? Final schema: ?H, ADG, BCD, BE
What are your comments about my mistakes?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…