2017-04-03 44 views
0

分配:如何BCNF分解時的屬性與任何其他人沒有關係

考慮的關係(,,,,,,)和FD組= {→,→,→,→ ,→,→}。 如果它不在BCNF中,則將它分解成一組BCNF關係。確保你的分解是無損的 - 加入。

說明

嗨,我的工作我的數據庫作業(設計相關章節)。 我想我已經根據課堂上的例子命令了基本過程。 然而,這裏棘手的部分是我們有一個屬性'H',與其他人沒有任何關係,這使我深深地困惑。我應該如何處理它?

試圖回答

• 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 

什麼是你對於我的錯誤的意見?

+0

步驟1錯誤。你使用什麼參考? – philipxy

+0

「保持不變」意味着什麼?你知道AB也是CK嗎?你知道一個關係可以有多個CK嗎?請在您遵循算法時給予它或對其進行引用,而不僅僅是跟隨它的(部分)跟蹤。另外,「與他人沒有關係」在通常的方式中將「關係」用於不同地用作技術術語的上下文中。你的意思是在任何其他屬性的FD中都沒有提到H. – philipxy

回答

0

你的第一個子彈是錯誤的。如果您轉到具有您嘗試遵循的BCNF分解算法的參考,它將不會有這一步。最後會說,將FD中沒有提到的屬性(函數依賴關係)添加到每個FD生成的BCNF組件模式之一中。