开发者

Is this database schema practical?

开发者 https://www.devze.com 2023-01-27 12:23 出处:网络
As sort of a follow up to this previous question: Normalizing a variety of properties with similar data types

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 met开发者_JAVA技巧hod? 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.


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:

  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.

0

精彩评论

暂无评论...
验证码 换一张
取 消