这个数据库模式实用吗?
作为上一个问题的后续: 使用相似数据类型标准化各种属性
现在已经创建了这个设置: http://schemabank.com/p/VwWHn
我的问题是我是否走在正确的道路上方法?我正在使用的设置是否存在明显的错误,或者我缺少标准化概念?我正在尝试寻找一种适用于现实世界场景的实用方法,因此如果有更好的方法来配置此数据库,我会很高兴听到。
As sort of a follow up to this previous question:
Normalizing a variety of properties with similar data types
I've created this setup now:
http://schemabank.com/p/VwWHn
My question is am I on the right path with this method? Is there an obvious mistake to the setup I'm using, or something about the concepts of normalization I'm missing? I'm trying to go for a practical approach that works in real world scenarios, so if there is a better method to configure this database I'd be happy to hear it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要一个platforms_data表,它允许您跨多个平台关联一款游戏。这可能是一个有意识的选择不这样做,但我想我会提到它。
另一件事是,对于发布日期,我假设您有一个单独的release_dates 表,以便您可以按发布日期选择所有内容。如果这不是您计划的一部分,那么您可能不需要额外的桌子,只需将其包含在游戏模型中即可。
另一件需要考虑的事情是,游戏通常在不同的国家/地区发布于不同的日期。由于您已经将多个国家/地区纳入架构中以进行评级,因此您也许可以考虑添加国家/地区表并删除特定于国家/地区的评级表。然后您可以拥有一个评级表,每个评级都有一个国家/地区作为外键。然后,您只需创建一个 ratings_data 表来将游戏与各种评级相关联。您还可以将country_id 添加到release_date_data 表中。这种方法将允许您扩展和添加更多国家/地区,而无需每次都更改架构。
You might want to have a platforms_data table, which would allow you to associate a game across more than one platform. This might be a conscious choice to not have this, but I thought I'd mention it.
The other thing would be that for release dates, I assume you have a separate release_dates table so that you can select all by release date. If that is not part of your plan, then you may not need the extra table and could just include it in the game model.
Another thing to consider is that games are often released in different countries on different dates. Since you are already bringing multiple countries into the schema for rating purposes, perhaps you could consider adding a country table and removing your country specific ratings tables. Then you could have a single ratings table, with each rating having a country as a foreign key. Then you would just have to create a ratings_data table to associate games with the various ratings. You could also use add the country_id to the release_date_data table. This approach will allow you to expand and add more countries without having to change your schema every time.
如何添加以下表格:
这样,如果您添加国家/地区或评级类型,则无需更改表结构。
How about adding the following tables:
That way, if you add a country or a rating type, you won't have to change table structures.