这个数据库模式实用吗?

发布于 2024-10-05 10:55:59 字数 380 浏览 0 评论 0原文

作为上一个问题的后续: 使用相似数据类型标准化各种属性

现在已经创建了这个设置: 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 技术交流群。

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

发布评论

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

评论(2

没有你我更好 2024-10-12 10:55:59

您可能需要一个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.

孤单情人 2024-10-12 10:55:59

如何添加以下表格:

  1. Country
  2. RatingsByCountry
  3. Ratings
  4. GameRatingsByCountry

这样,如果您添加国家/地区或评级类型,则无需更改表结构。

How about adding the following tables:

  1. Country
  2. RatingsByCountry
  3. Ratings
  4. GameRatingsByCountry

That way, if you add a country or a rating type, you won't have to change table structures.

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