问题
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?
回答1:
Your first bullet is wrong. If you go to a reference like a published academic textbook that has a correct BCNF decomposition algorithm then it will not have that step.
来源:https://stackoverflow.com/questions/43181422/how-to-bcnf-decompose-when-an-attribute-has-no-relation-with-any-others