数据库设计理念

发布于 2024-12-29 08:01:50 字数 326 浏览 0 评论 0原文

我需要建议希望场景最有效地表示我的数据

表(A)字段:

ID(键),宽度(数字),高度(数字)

表(B)字段:

ID(键),描述(字符串),价格(编号)

表(A)包含大部分基本数据,但该表中的一条记录可以包含表(B)中的多条记录

例如:记录A2可以有B1,B2,而记录A3可以有B2,B3,B4

现在应该我使用主/详细1对多关系?在这种情况下,用户将重复从表 (B) 中为每个相似值输入相同的“描述”字段

,或者我应该创建第三个表 (AB) 来保存 A 和 B 中的相关数据?

谢谢

I need advise wish scenario is most efficient to represent my data

Table (A) fields:

ID (key), width (number), Height (number)

Table (B) fields:

ID (key), description (string), price (number)

Table (A) that have most of the basic data but one record from this table can have multi records from table (B)

For example: record A2 can have B1, B2 while record A3 can have B2, B3, B4

Now should I use master / detail 1 to many relation ? in this case the user will repeat entering the same "description" field from Table (B) for each similar value

or I should create a third table (AB) to hold the related data from both A and B ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

但可醉心 2025-01-05 08:01:50

在这种情况下,用户将为每个相似的值重复输入表 (B) 中的相同“描述”字段

我不知道你的意思,但对我来说,它看起来像一个典型的多对多关系(A2有B1, B2和B2有A2、A3)。在这种情况下,我建议创建第三个“(AB)”表。

in this case the user will repeat entering the same "description" field from Table (B) for each similar value

I don't know what you mean by this but to me it looks like a typical many to many relation (A2 has B1, B2 and B2 has A2, A3). In that case, I would suggest creating the third "(AB)" table.

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