如何规范化这个数据库设计? [英] How do I normalise this database design?

查看:165
本文介绍了如何规范化这个数据库设计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为客户创建一个划船报告和统计系统,我现在有一个类似于以下内容的结构:

  ------------------------------------------------ ----------------------------- 
| ID |团队|教练|划船者|事件|职位|时间|
---------------------------------------------- -------------------------------
| 18 | TeamName | CoachName1 | RowerName1 | EventName | 1 | 01:32:34 |
| | | CoachName2 | RowerName2 | | | |
| | | | RowerName3 | | | |
| | | | RowerName4 | | | |
---------------------------------------------- -------------------------------

这是一个示例数据行,但是我想将其扩展为Rowers表和Coach表等,但是我不知道如何最好再将其链接到任何人都可以得到任何可以与我分享智慧的话语。



> 更新



团队可以拥有任意数量的教练和划船者,Rower可以在许多团队(A,B,C等等) )和一个团队可以有很多教练。

解决方案

我将与团队,教练,划船员(也许运动员如果



团队



TeamID



教练



CoachID





RowerID



活动



EventID
TeamID
RowerID



还有很多其他问题可以进一步定义关系,如:什么定义了条目(事件)?是一组划船者和一个教练PER事件?每个事件一组划船者有多个教练?有队吗?什么组成一个团队?



我会问这样的问题...


I am creating a rowing reporting and statistics system for a client where I have a structure at the moment similar to the following:

-----------------------------------------------------------------------------
| ID | Team     | Coaches    | Rowers     | Event     | Position | Time     |
-----------------------------------------------------------------------------
| 18 | TeamName | CoachName1 | RowerName1 | EventName | 1        | 01:32:34 |
|    |          | CoachName2 | RowerName2 |           |          |          |
|    |          |            | RowerName3 |           |          |          |
|    |          |            | RowerName4 |           |          |          |
-----------------------------------------------------------------------------

This is an example row of data but I would like to expand this out to a Rowers table and Coaches table and so on but I don't know how best to then link that back to the Entries table which is what this is.

Has anybody got any words of wisdom they could share with me?

Update

A Team can have any number of Coaches and Rowers, a Rower can be in many Teams (Team A, B, C etc) and a Team can have many Coaches.

解决方案

I would go with separate tables for Teams, Coaches, Rowers (maybe Athletes if there are more than one type of sport that you'll want to scale to) and Events.

Teams

TeamID

Coaches

CoachID

Rowers

RowerID

Events

EventID TeamID RowerID

There are a lot of other questions that will further define the relationships, like: What defines the entry (event)? Is it one set of rowers and one coach PER event? Multiple coaches per a set of rowers per event? Are there Teams? What makes up a team?

I'd be asking questions like that...

这篇关于如何规范化这个数据库设计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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