星型模式建模 - 多对多

发布于 2024-12-07 10:33:16 字数 483 浏览 1 评论 0原文

当我学习这个范例时,我正在基于 NFL 统计数据构建一个数据仓库,用于教育目的 - 我有以下建模问题

球员可以在不同年份为不同球队效力,同样教练可以在职业生涯的不同年份执教不同球队;球员也可能在不同的年份扮演不同的位置(罕见但有可能)

对不同年份的球员、教练和球队之间的分配进行建模的最佳方法是什么?

我可以将不同年份的名单信息存储在一个维度中吗?例如,DimTeamRoster 将具有 TimeKey、TeamKey 和 CoachKey(因为一支球队只能有一名主教练),而 FactTeamRoster 则具有 TeamRosterKey、PlayerKey、Positionkey

或者我是否会拥有一个 FactTeamRoster,其中将具有 TimeKey、TeamKey、PlayerKey、PositionKey?但是这种方法是否有意义,因为这个事实表不会真正存储任何度量,它只是存储当年的作业

还有哪些其他可能的解决方案以及每种方法的优点/缺点/正确性?

I'm building a data warehouse based on NFL statistics for educational purposes as I learn this paradigm - I have the following modelling problem

Players can play for different teams different years and similarly coaches can coach different teams different years of their career; players could also potentially play different positions in different years too (rare but possible)

What is the best way to model the assignment between players, coaches and teams for different years?

Would I store the different years' roster information in a dimension? eg DimTeamRoster which would have a TimeKey, TeamKey and CoachKey (since a team can only have one Head Coach) with a FactTeamRoster with a TeamRosterKey, PlayerKey, Positionkey

Or would I have a FactTeamRoster which would have a TimeKey, TeamKey, PlayerKey, PositionKey? But then would this approach make sense because this fact-table wouldn't really be storing any measures, it would be simply storing the assignment for that year

What're some of the other possible solutions and pros / cons / correctness of each approach?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

自控 2024-12-14 10:33:17

对于初学者来说,我认为这样就可以了。

在此处输入图像描述

dimRole 可能看起来像这样

RoleKey     RoleName        RoleGroup
---------------------------------------
  1         quarterback      player
  2         tackle           player
  3         head coach       coach
  4         assistant coach  coach

For starters, this would do -- I think.

enter image description here

dimRole may look something like

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