BCNF分解(数据库设计)
我正在尝试将几个表分解为 BCNF。我相信第一个分解正确,但我不确定其他是否可以分解。任何帮助表示赞赏
**make(id, name, est, founder, city, state)**
id->name;
name->est, city, state, founder;
city->state
New Relations: [Key(id),name], [Key(name),est,city,state,founder], [Key(city),state]
**model(id, makeId, name, year, category)**
id->makeId, name;
name->year, category (not superkey, but can't really decompose)
**features(id, modelId, abs, tpms, sidebags, drl)**
id->modelID, abs, tpms, sidebags, drl
**user(id, name, pass, first, last, phone, isAdmin)**
id->name, pass, isAdmin; name->first, last, phone
**selling(id, price, modelId, mileage, userId)**
id->price, modelId, mileage, userID
I'm trying to decompose several tables into BCNF. I believe the first one is decomposed correctly, but I'm unsure whether or not the others can be decomposed. Any help is appreciated
**make(id, name, est, founder, city, state)**
id->name;
name->est, city, state, founder;
city->state
New Relations: [Key(id),name], [Key(name),est,city,state,founder], [Key(city),state]
**model(id, makeId, name, year, category)**
id->makeId, name;
name->year, category (not superkey, but can't really decompose)
**features(id, modelId, abs, tpms, sidebags, drl)**
id->modelID, abs, tpms, sidebags, drl
**user(id, name, pass, first, last, phone, isAdmin)**
id->name, pass, isAdmin; name->first, last, phone
**selling(id, price, modelId, mileage, userId)**
id->price, modelId, mileage, userID
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BCNF 很简单:只需确保单个关系中属性集之间的所有依赖关系都依赖于该关系的超键。你的第一个关系很接近,但第二个关系需要省略“状态”。通常,人们会停留在 3NF,因为并非所有与 FD 的关系都具有保留依赖的 BCNF 分解。您需要帮助分解其他关系吗?如果你需要的话我会帮忙的。
编辑:帮助其他关系。
销售和功能都很好。模型和用户需要在名称上分开才能处于 BCNF 中;您表明这不是您可以为模特做的事情。为什么?名字暗示了箭头右边的东西,对吗?
BCNF is easy: just make sure all dependencies between attribute sets in a single relation are dependencies on a superkey of the relation. Your first one is close, but the second relation needs to omit "state". Often, people stop at 3NF since not all relations with FDs have dependency-preserving BCNF decompositions. Do you need help decomposing the other relations? I will help, if you need it.
Edit: Help on other relations.
Selling and Features are fine. Models and Users need to be split on Name in order to be in BCNF; you indicate this isn't something you can do for Models. Why? Name implies the stuff on the right of the arrow, right?