用于收集日常信息的数据库架构
我想知道实现一个包含日常信息(即 NHL 曲棍球统计数据)的简单数据库的最佳解决方案是什么。当然,我想到了一个 Player
表和一个 Team
表,其中将包含每个球员和球队的最新统计数据。我主要关心的是,我希望能够存储赛季中任何一天的统计数据,这样就可以比较某个日期范围内给定球员的统计数据。为此,我考虑为每个球员创建一个表,其中包含赛季中每一天的行。这个解决方案可能很有趣,但考虑到 NHL 中有超过 500 名球员,这会导致桌子太多。我的问题是,如何根据我的需求设计数据库架构?
我将使用 SQL Server 2008 R2 以及 ASP.NET MVC 3 和实体框架。
I am wondering what would be the best solution to implement a simple database that will contain day-to-day information, that is, NHL hockey statistics. Of course I thought of a Player
table and a Team
table, which will contain up to date statistics for each players and teams. My main concern is that I would like to be able to store statistics on any given day of the season, so it will be possible to compare statistics of a given player in a date range. To do this, I thought of creating a table for each player which would contain rows for each day of the season. This solution might be interesting, but considering there are over 500 players in the NHL, this would result in too many tables. My question is, how could I design my database schema according to my needs?
I will be using SQL Server 2008 R2 along with ASP.NET MVC 3 and the Entity Framework.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
步骤 1. 购买 Ralph Kimball 的《数据仓库工具包》一书。
步骤 2. 阅读“星型架构”。
步骤 3. 使用您的事实(可测量的数量)和维度(玩家、团队、时间、游戏)设计星型模式。
在您了解星型模式如何工作之后,这非常简单。
Step 1. Buy Ralph Kimball's Data Warehouse Toolkit book.
Step 2. Read about the "Star Schema".
Step 3. Design a star schema with your facts (measurable quantities) with dimensions (player, team, time, game).
It's pretty straightforward -- after you know how Star Schema works.