1

Its often stated that to reach 1nf, a new entity has to be created and that entity has to have a composite key.

LeadID | leadDate | Name | DOB | streetAddress | city | state | residenceType

If I was to normalize streetAddress, city, state, residenceType into a new entity, I would have to create a new primary key right then and there. I cannot use LeadID because that would mean that addresses cannot be created without a lead, which is not true. And I cannot use streetAddress because the streets are not good candidates (5123 glowsville way st. n ave. is not a good key at all).

So I am forced to simply create a key for this new entity. Is this alright?

4

2 に答える 2

5

第 1 正規形は次のことを意味します。

各属性のドメインに原子値のみが含まれ、各属性の値にそのドメインの単一の値のみが含まれる場合、関係は第 1 正規形です。

したがって、列に複数の道路を格納していない限りstreetAddress、既に第 1 正規形に準拠しています。

于 2013-04-28T06:53:35.710 に答える
3

1NF は、複合キーの存在とは何の関係もありません。1NF を満たすには、テーブルは関係を正確に表現している必要があり、したがって少なくとも 1 つの候補キーが必要です。これには、複合キーが含まれる場合と含まれない場合があります。

おそらく、分解による正規化を教えるために時々使用されるデータベース設計理論の概念であるUniversal Relation Assumptionを念頭に置いているでしょう。URA は、必要なすべての関係が非損失分解によって取得できる関係が存在することを前提としています。通常、ユニバーサル リレーションには複合キーがあります。URA 自体は議論の余地があり、間違いなく疑問の余地がありますが、設計理論の問題を考える 1 つの方法であることに注意してください。

正規化理論は厳密には新しい属性の導入を必要としません。原則として、属性と依存関係は与えられていると想定されます。

于 2013-04-28T10:24:24.267 に答える