需要帮助创建数据库的结构 [英] Need help creating structure to database

查看:105
本文介绍了需要帮助创建数据库的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在处理统计数据的网站上工作,参加体育比赛。 IE我的网站将让用户快速查找哪个玩家在一个游戏/季节得分最高,或者1个玩家记录是对另一个玩家或团队。






当您点击一个回合。示例round4 game1(这是Hurricanes vs Crusaders)该游戏的统计信息以及该游戏的所有玩家统计信息(对于两个团队)都会显示。因此:







此外,游戏统计信息还会显示如下:



现在尝试将此文件上传到数据库,以便用户可以:




显示最佳和最差球员和球队统计资料 p>这个问题让我忙了3天,在现在的阶段,我开始把头发从我的头。我只是不能得到一个有效的方式来链接表在一起。



我应该为每个单独的比赛创建一个表吗?或者我应该为所有球员创建1个表,为所有球员创建1个表?如果是这样,我作为我的主键使用什么?



我知道这是一个很长的问题,所以任何人谁花时间阅读这个感谢,提前,如果任何人都可以指向我正确的方向或只是给我一个意见,这将是非常感谢。 im只是完全烂了这一个。

解决方案

以最低适用级别捕获统计信息。您希望将数据库规范化的原则应用于初始设计。



一旦你决定了你需要什么报告并确定了什么样的性能挑战,你就可以获得最直接的数据捕获场景,



请考虑以下逻辑数据模型:

$

b
$ b


Im working on a website that processes statistics, for a sporting competition. I.E my site will let users quickly look up which player(s) scored the most points in a game/season or what 1 players record is against another players or team.

My data for previous games are displayed like this

When you click on a round. Example round4 game1 (Which is Hurricanes vs Crusaders) The statistics for that game and all player statistics for that game (for both teams) gets displayed. As such:

Furthermore game statistics also gets displayed like this:

Now im trying to upload this to a database, so that users can:

  1. Compare 1 players record against another players record
  2. Compare 1 players record against a specific team
  3. Compare a teams record against another teams record
  4. Display best and worst player and team statistics

This problem has kept me busy for 3 days, im at the stage now where Im starting to pull the hair out of my head. I just can not get an efficient way to link the tables together.

Should I create a table for each individual match? or Should I create 1 table for all matches and 1 table for all players? If so what do I work with as my primary keys?

I know this is a long question so to whomever took the time to read through this thank you in advance, if anyone could point me in the right direction or just give me an opinion it would be GREATLY appreciated. im just completely stumped on this one.

解决方案

Capture the statistics at the lowest applicable level. You want to apply the principles of database normalization to your initial design. This gives you the most straight-forward data capture scenario while leaving you the most flexibility for reporting.

Once you decide exactly what reporting you need and have determined what performance challenges you may be facing, then you can apply denormalization to create reporting data warehouse tables.

Consider the following logical data model:

这篇关于需要帮助创建数据库的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆