2014-05-18 60 views
0

我有闖入BCNF這是一個問題:奇BCNF分解本人以往的考試

Relation: R[A E P M N S T L] 

FD's: 
A -> EM, 
A -> L, 
M -> ST, 
M -> N, 
S -> T, 
E -> P, 
P -> E, 
L -> A 

這一次是在我過去的考試之一,我真的不知道如何解決它。

-------------- BCNF ALGORITHM ------------ 
1. Take a FD that violates BCNF. 
2. Decompose the FD to two other relations 
3. First relation: The whole FD 
4. Second relation: The rest of the Relation + the left hand side of the chosen FD 
5. Iterate until all the new relations have key on its left hand side 
-------------- BCNF ALGORITHM ------------ 

And I also tried another one that is basically the same, but written in a different way: 
X->Y: R1({X}+), R2(R - {X}+ ; X) (Relation minus {X}+ (XY in this case), plus X. 

到目前爲止,我在這裏:

我的女人(珍妮弗·威登)是誰寫的我們當然文學學會了這對coursera 顯然,A是關鍵,所以它的文件描述符已經在BCNF。問題是,我可以擦除任何多餘的FD嗎?如果是這樣,拇指規則是什麼?

R1(MST) <-- BCNF. 
R2(A E P M N L) 
R3() 

並不知道該去哪裏。

回答

0
1. Take a FD that violates BCNF. 
5. Iterate until all the new relations have key on its left hand side 

步驟1中提BCNF違反只能意義,如果它意味着你應該確定鍵和每個原始的非鍵隱含的防衛和安全產生關係。另外,步驟5的終止不能僅僅在左側存在鍵時,因爲可能存在非鍵確定符。顯然,當所有關係都在BCNF時停止是必要和充分的。算法的特定完整描述可以描述等同的重組和/或測試,而不明確提及BCNF。

如果A是一個關鍵,那麼因爲L-> A,L也是。

MSTNAELP keys A and L plus M->ST, S->T, E<->P 

那些FD來自非密鑰。你選擇了M-> ST。我們得到:

MST key M plus S->T 
MNAELP keys A and L plus E<->P 

兩者都有確定鍵不是來自鍵,因此不在BCNF。選擇S-> T和E-> P。我們得到:

ST key S in BCNF 
SM key M in BCNF 
EP keys P and E in BCNF 
EMNAL keys A and L in BCNF