BCNF分解(数据库设计)

发布于 2024-11-27 00:12:06 字数 713 浏览 1 评论 0原文

我正在尝试将几个表分解为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2024-12-04 00:12:06

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文