简体   繁体   English

数据库归一化为3NF或BCNF

[英]Database normalization into 3NF or BCNF

I am working on a Database normalization to make it minimum 3NF, but I can't continue only in the last one. 我正在对数据库规范化以使其最小3NF,但是我不能仅在最后一个中继续。

The last table I'have the following keys. 最后一张桌子我有以下按键。 ID, Organization_number and name. ID,组织编号和名称。 ID is Primary key. ID是主键。 ID can determines ORG_NR and Name, also ORG_NR can determines ID and name. ID可以确定ORG_NR和名称,ORG_NR也可以确定ID和名称。 I know that is violation of 3NF. 我知道这违反了3NF。 So my questions are, what I should do to make it to 3NF or even BCNF. 所以我的问题是,我应该怎么做才能达到3NF甚至BCNF。

If I i Split it into to table, that makes relation one to one. 如果我将其拆分到表中,则将关系一对一。

我的桌子

Functional dependencies determine candidate keys. 功能依赖关系确定候选键。 A primary key is just some CK that you decided to call PK. 主键只是您决定调用PK的某些CK。 Other than being CKs, PKs have no role in normalization. 除了是CK外,PK在标准化中没有任何作用。 Presumably you know that ID is unique (and {} isn't a CK), so it is a CK, which you have made PK. 大概您知道ID是唯一的(并且{}不是CK),所以它是一个CK,您已将其制成PK。 (But you should make that clear.) (但是您应该清楚一点。)

Since both {ID} and {ORG_NR} determine all other attributes and no smaller subset of each does, they are both CKs. 由于{ID}和{ORG_NR}都确定了所有其他属性,并且每个属性都没有较小的子集,因此它们都是CK。 Presumably the only FDs are the ones that follow from these. 大概唯一的FD就是这些衍生出来的。 (But you should make that clear.) Since all the non-trivial FKs are out of superkeys, this is in BCNF (& so also 3NF). (但是您应该清楚地说明这一点。)由于所有非平凡的FK都没有超键,因此这是在BCNF中(因此也是3NF)。

PS Since you (wrongly) think that this is not in 3NF, find a definition for 3NF and try to show whether it satisfies 3NF. PS:由于您(错误地)认为这不是3NF,因此请找到3NF的定义,然后尝试显示其是否满足3NF。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM