这是来自我的数据库课程的一个示例期中考试的问题。中期没有给我们解决方案,我只是想问一下我的解决方案在任何意义上是否正确
Consider the following relation T=(N,A,I,V,L,P,C,D)
with the FD={N->AI , AV->LP, VC->PD, VL->P, LA->D, NP->IVL, CID-> LVP, AD->IP}
Find all candidate keys that consist of 3 attributes if any?
我试图解决这个问题,这就是我得到的:
Left Attributes = N,C
Middle Attributes = A,I,V,L,P,D
Right Attributes = None
然后我用 NC 制作了 3 个属性对并找到了它们的闭包:
NC+ = {NCAI} NO
NCA+ = {NCA} NO
NCI+ = {NCI} NO
NCV+ = {NCVPDAIL} = Get PD from VC->PD AND AI from N->AI and L from NP->IVL? Is this correct? If IV is already in there can I use this dependency to get L?
NCL+ ={NCLAIDVP} = Get AI from N->AI & D from LA->A and VP from CID->LVP using same logic from above?
NCP+ = {NCPAIVLD} straight forward using same logic from above
NCD+ = {NCDAILVD} YES
所以我得到了 4 个候选键,其中包含 3 个属性。分别是NCV、NCL、NCP、NCD。
那么我确定了它还是应该只有一个候选键应该是NCD?
谢谢!