功能依赖和正常形式 - 数据库

时间:2017-03-27 12:54:09

标签: database functional-dependencies

在这里,我做了两个关于功能关系和正常形式的问题,我有一些后续问题,我无法找到答案。

1. On the relation scheme R(A, B, C, D, E, F) on which following 
functional dependencies are being applied:
F = {ABC →D, CE→B, E→C, BF→AC, E→F, F→E}. 
• Find (AB)+, (CD)+,(EF)+ 
• Find all candidate keys. 
• Find all function dependencies which cause this relation not to be at BCNF. 
(AB)+=AB | (CD)+=CD | (EF)+=EFCBAD

Find all candidate keys
(AB)+=AB     | (BF)+=BFECAD
(AC)+=AC     | (CE)+=CEBFAD
(AE)+=AECFBD | (CF)+=CFEBAD
(AF)+=AFECBD | (EF)+=EFCBAD
(BC)+=BC     | **(E)+=EFCBAD**
(BE)+=BECFAD | **(F)+=FECBAD**
Candidate keys are: E and F
Prime attributes are: E and F
Non-prime attributes are: A, B, C, D
Other Keys that functionally determines relation scheme R are not 
candidate keys because they don’t fulfill "minimality" rule!

第二

2. On the relation scheme R = (A, B, C, D, E, F G, H) on which following 
functional dependencies are being applied:

F= {A →E, GH → C, DB → H, BG → A, C → D, G → H, H → B, AE → G} 
• Find (A)+ and (DBG)+ 
• Does G →B applies from fd F 
• Find all candidate keys. 
• In which normal form is following relations scheme? 
(AB)+=AB| (CD)+=CD | (EF)+=EFCBAD

Find all candidate keys:

**(A)+=AEGHBCD** | (B)+=B | (C)+=CD | (D)+=D | (E)+=E | (F)+=F | **(G)+=GHBCDAE** | 
(H)+=HB

Candidate keys are: A and G
Other Keys that functionally determines relation scheme R are not
candidate keys because they don’t fulfil minimality rule!
Prime elements are: A and G
Non prime elements are: B, C, D, E, H
1NF – yes
2NF – yes, because there are no partial key dependencies
3NF – no, because ABC ->D (functional dependency between 2 non-prime elements).
BCNF – no, because it is not in 3NF

问题: 1)我写的所有这些是对的吗?

2)在第1个问题中,有很多键由2个元素组成,但它们不是候选键,因为" minimal"规则不适用于他们。我是对的吗?

3)如果键的一部分是非素数而部分是素数元素并且该键在功能上确定了一些其他非素数元素,该怎么办?是第3范式的关系吗?

4)如果键(素数元素)的候选部分在功能上确定另一个素数元素,那么第二范式的关系是什么?

5)如果有很多键具有"最小化"特征和它们是候选键,它们是否都作为候选键应用(例如10个候选键)?

6)在这里的第二个问题,F元素没有在任何功能依赖中使用,但它是关系方案的一部分。我是否将元素F输出,或者元素F必须是候选键的一部分(也是主要属性/元素)?

0 个答案:

没有答案