首页 > 解决方案 > 赛马数据库;如何以正确的方式做到这一点?

问题描述

我正在建立一个赛马数据库。每个比赛结果都有(至少)以下参数:

然后是马匹、骑师和训练师以及他们取得的位置。像这样:

  1. 地方:
    • 马名
    • 陛下
    • 所有者
    • 教练员
    • 骑师
    • 重量
    • 官方评级
    • 其他评级
    • 重量
    • 赔率
    • 其他的东西。
  2. 地方 (...)
  3. 等等。

由于世界上有很多比赛,我正在努力为数据库创建一个结构,将比赛和结果联系起来,并能够搜索特定马匹的结果。

我将非常感谢提示如何根据马匹的结果和具体参数来排序比赛的参数。

标签: mysqldatabase-design

解决方案


我建议如下:

1 Table for the race places (PlaceId, Name, Address etc)
2 Table for the horses (HorseId, Name, Owner, Age etc)
3 Table for the Jockeys (JockeyId, Name, Company, Age etc)
4 Table for the Races (RaceId, Link to PlaceId, Name, Date etc)
5 Table for the Attendees (Link to RaceId, Link to HorseId, Link to JockeyId, Ranking)

推荐阅读