数据库设计理念
我需要建议希望场景最有效地表示我的数据
表(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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你的意思,但对我来说,它看起来像一个典型的多对多关系(A2有B1, B2和B2有A2、A3)。在这种情况下,我建议创建第三个“(AB)”表。
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.