How to BCNF decompose when an attribute has no relation with any others

二次信任 提交于 2019-12-12 02:31:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!