【发布时间】:2014-03-22 05:19:53
【问题描述】:
我想弄清楚如何规范化表中的一些数据。无论我如何尝试,我仍然会得到重复组!谁能给我一些关于这些数据的指导?
这是我要规范化的数据:
LANDLORD LANDLORD GROUP QUARTER YEAR ESTIMATED ACTUAL
Housing Leeds Yorkshire LL 3 2013 221 235
Housing Leeds Yorkshire LL 2 2014 206
Manchester housing Northwest housing associates 3 2012 134 130
Liverpool properties Northwest housing associates 2 2012 539 592
Liverpool properties Northwest housing associates 3 2014 567
Manchester housing Northwest housing associates 2 2013 157 157
Liverpool properties Northwest housing associates 2 2014 527
Housing Leeds Yorkshire LL 3 2012 238 240
Liverpool properties Northwest housing associates 4 2012 585 460
Manchester housing Northwest housing associates 1 2012 125 136
Manchester housing Northwest housing associates 3 2014 150
Liverpool properties Northwest housing associates 3 2012 569 585
Housing Leeds Yorkshire LL 1 2013 195 214
Manchester housing Northwest housing associates 2 2012 132 140
Manchester housing Northwest housing associates 2 2014 152
Liverpool properties Northwest housing associates 2 2013 555 577
Housing Leeds Yorkshire LL 3 2014 215
Manchester housing Northwest housing associates 4 2014 114
Manchester housing Northwest housing associates 1 2014 140
Manchester housing Northwest housing associates 3 2013 160 157
Liverpool properties Northwest housing associates 3 2013 528 537
Liverpool properties Northwest housing associates 1 2014 596
Housing Leeds Yorkshire LL 2 2012 226 231
Manchester housing Northwest housing associates 4 2013 111
Manchester housing Northwest housing associates 1 2013 135 136
Housing Leeds Yorkshire LL 1 2014 231
Liverpool properties Northwest housing associates 4 2013 536
Manchester housing Northwest housing associates 4 2012 105 96
Liverpool properties Northwest housing associates 1 2013 527 560
Housing Leeds Yorkshire LL 4 2013 226
Housing Leeds Yorkshire LL 2 2013 198 214
Housing Leeds Yorkshire LL 4 2014 235
Liverpool properties Northwest housing associates 1 2012 494 536
Housing Leeds Yorkshire LL 4 2012 181 197
Liverpool properties Northwest housing associates 4 2014 568
Housing Leeds Yorkshire LL 1 2012 201 209
提前感谢您的帮助。
【问题讨论】:
-
到目前为止您尝试过什么,您想要的结果是什么?看起来每一行都是独一无二的,您可以为
Landlord和Landlord Group创建一个查找表以节省一些空间。 -
我想我通过尝试正常化来使事情复杂化。我创建了一个包含季度、估计和实际的表。然后我用 Quarter 和 Year 创建了另一个表。我使用第一个表中的 Quarter 作为外键。我想我是想减少季度和年度的重复。但是您对使用查找表的建议对我来说听起来要好得多。感谢您的帮助。
标签: mysql sql database database-design database-normalization