澄清目前两种居住安排的正常化
我正在阅读有关数据库规范化的文档:"Nermalization"(原文如此!)。我唯一没有看到解释的是如何处理一只同时住在两个地点或同时使用两个名字的猫。
以下是我正在处理的示例:我有一个与 ContentID
一起使用的标题,其推荐的发行季节是秋季和春季。
那么,我是否要在数据库的标准化部分创建一个 distribution_recommendation_by_contentID
表?
I was reading a document about database normalization: "Nermalization" (sic!). The only thing that I don't see explained is how to deal with a cat who lives at two locations at the same time, or uses two names at the same time.
Here's an example of what I am dealing with: I have a title that lives with ContentID
whose recommended distribution seasons are Fall and Spring.
So, do I create a distribution_recommendation_by_contentID
table in the normalized section of my database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有多个空结尾结果。
Have multiple null-ending results.
如果您只有两个值(秋季和春季)。我不会只为这两个值创建额外的表。否则,您始终需要一个连接语句来检索推荐信息,这将影响数据库的性能。
如果每个内容只有一个分布值(如秋季、春季等),最好保留在一张表中。
另一种情况是每个内容有多个分布值。假设标题 A 有两个分布值:秋季和冬季。比拥有一个额外的表来保存这些信息(distribution_recommendation_by_contentID)更有意义。
如果您有一个需要显示可用分布值的用例,那么您可以为分布值和分布值的引用 ID 创建另一个表。
If you have only two values (Fall and Spring). i would not create an extra table for only these two values. Otherwise you need always a join statement to retrive the recommendation information which will effect performance of your database.
If each content has only one distrubution value(like Fall, Spring, etc), it is better to keep in one table.
The other case is that each content have more than one distrubution value. Let's say Title A has two distrubution value Fall and Winter. Than it makes sense to have an extra table to keep these information(distribution_recommendation_by_contentID).
If you have a use case that you need to show available distrubution values, then you can create another table for distrubution values and reference id of distrubution values.