我想创建一个数据库来存储有关事件的信息,并为每条记录提供以下详细信息:
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数据库吗?我的意思是一个合适的数据库名称,无论我需要一个还是多个表,我需要创建哪些字段。
我可能会在脑海中过度复杂化,但我想知道数据库中是否存在“图层”,或者我是否只有round1 date
,round1 location
等单个字段, ....,round2 date
等,而不是像每个回合的子表一样的event1 rounds
。
答案 0 :(得分:0)
命名数据库时,通常是项目或公司名称。 在这种情况下你的游戏名称
用于保存数据,您需要考虑规范化规则。从中你可以想到应该有多少个表和哪个表数据。 在这种情况下,一个事件有多轮
在命名表时,我更喜欢为父级添加前缀,以便可以轻松找到所有内容。
完全放完
数据库名称:公司/游戏名称
<强>事件强>
event_id(唯一),玩家1,玩家2,最终得分,
<强> event_round 强>
event_id,round_id(唯一),轮数,日期,位置,
<强> event_round_important 强>
round_id,important_data,