用于两轮事件的MYSQL数据库结构 [英] MYSQL Database Structure for 2-round Events

查看:183
本文介绍了用于两轮事件的MYSQL数据库结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个数据库来存储有关每个记录的以下详细信息的事件:

I'd like to create a database to store information about events with the following details for each record:

Event, Player 1 name, Player 2 name, Final score

Round 1:
Date, location, Important detail 1, Important detail 2

Round 2:
Date, location, Important detail 1, Important detail 2

有人可以告诉我这将如何转换一个mySQL数据库?我的意思是一个合适的数据库名称,无论我需要一个或多个表,我需要创建什么字段。

Could someone tell me how this would translate to a mySQL database please? I mean by that a suitable database name, whether I need one or multiple tables, what fields I need to create.

我可能会把我的想法变得过于复杂,但是我想知道数据库中是否存在层,或者我是否只有个别字段,例如 round1 date round1 location ,...., round2 date 等,而不是像 event1 rounds

I might be over-complicating things in my mind, but I'm wondering if there are "layers" in a database or whether I would just have individual fields such as round1 date, round1 location, ...., round2 date etc, as opposed to something like event1 rounds with sub tables for each round.

推荐答案

当命名数据库时,通常是项目或公司名称。
在这种情况下,您的游戏名称

When naming database it is normally project or company name. in this case your game name

保留数据,您需要考虑规范化规则。从那里你可以想到有多少表和哪些表数据应该去。
在这种情况下,一个事件有多个回合

for keeping data you need to consider normalization rules. from that you can think how many tables and which table data should go. in this case one event has multiple rounds

当命名表我喜欢前缀父,所以可以很容易地找到。

when naming tables i prefer prefixing parent so things can be find easily.

所以放在一起

数据库名称:公司/游戏名称

事件

event_id(唯一),播放器1,播放器2,最终分数,

event
event_id(unique), player 1, player 2, final score ,

event_round

event_id,round_id(unique),round number,date,location,

event_round
event_id, round_id(unique), round number, date, location,

event_round_important br>
round_id,important_data,

event_round_important
round_id, important_data,

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

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