步骤:1、求出关系模型R的所有候选码
2、根据BCNF和3NF的定义进行判断。
例题1
Consider the following relational schema R(A,B,C).
suppose that the only dependencies (functional or multivalued) that hold on the relation in this schema are BC->A, A->C, and all dependencies that follow from these two.
This schema is in
A、3NF
B、BCNF
C、4NF
D、none of these
1.由于没有能推出B的,说明B是候选码的真子集。然后看AB能推出C,说明AB是候选码;看BC能推出A,说明BC也是候选码。
故所有候选码是AB,BC。
2.判断3NF:
由于A-BC=A在候选码AB中,C-A=C在候选码BC中,满足3NF的定义,所以是3NF。
3.判断BCNF:
BC是超码(因为之前求出BC是候选码),但是A不是超码(AB才是超码),故不满足BCNF的定义,不是BCNF。
例题2
(a)由于C和D不能被推出,说明CD是候选码的真子集。然后看ACD可以推出B、E,说明ACD是候选码。同理可以推出BCD,ECD也是候选码。
故所有候选码是ACD,BCD,CDE。
(b)B-A=B在BCD中,E-BC=E在CDE中,A-ED=A在ACD中,故是3NF。
(c)A,BC,ED都不是超码,故不是BCNF。