我试图弄清楚如何规范化表中的某些数据。无论如何尝试,我仍然会得到重复的分组!有人可以为我提供有关此数据的一些指导吗?
这是我要规范化的数据:
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
在此先感谢您的帮助。
最佳答案
正如Goat CO所建议的,您可以在此表上创建两个参考表,分别为Landlord
和LandLord Group
。然后将其与您的主表相关联。
因此,在那种情况下,您可以有三个表,分别是LandLord,LandLordGroup和LandRental表。
您可能会拥有以下Tables
和Fields
:
Table : LandLord
Fields : LandLordID, LandLordName
Table : LandLordGroup
Fields : LandLordGroupID, LandLordGroupName
Table : LandRental
Fields : LandRentalID, LandLordID, LandLordGroupID, Quarter, Year, Estimate
不要在这里直接使用
no repeating groups
中的1NF
(第一范式)规则,因为现在重复组都是参考表(即LandLord,LandLordGroup)中的所有foreign keys
。另外请注意,我现在在您的主表(即LandRental)中添加了Primary Key
(LandRentalID)。