0

私はこの関係を正規化しようとしています:

film_year  film_name  critic_id critic_name cinemas_debut           score
     2004  I robot          111        John  NY_cinema, LA_cinema       4 
     2004  I robot          222     Mathiew  NY_cinema, LA_cinema       5

どこ ...

  • film_year および film_name は、映画を識別します。
  • Cinemas_debut は多価属性です。
  • 評論家 ID -> 評論家名
  • film_year、film_name、critic_id -> スコア

3FN との関係を変換できません。これは私が試したことです:

  • ステップ1

1NF へ: 繰り返し要素または要素のグループはありません:

film_year  film_name  critic_id critic_name cinemas_debut           score
     2004  I robot          111        John  NY_cinema                  4 
     2004  I robot          222     Mathiew  LA_cinema                  5
     2004  I robot          111        John  NY_cinema                  4 
     2004  I robot          222     Mathiew  LA_cinema                  5
  • ステップ2

2NF へ: 連結キーへの部分的な依存関係はありません: PK としfilm_year, film_name, critic_id, cinemas_debutます。次にcritic_namescore部分的な従属関係から、この属性をそれらの行列式のコピーとの関係から外します。

 critics ( critic_id (pk), critic_name )
 reviews(film_year (pk), film_name (pk), critic_id (pk), score)

しかし、結果の関係をどうするかわかりません:

film_year  film_name  critic_id cinemas_debut          
     2004  I robot          111    NY_cinema                   
     2004  I robot          222    LA_cinema                  
     2004  I robot          111    NY_cinema                   
     2004  I robot          222    LA_cinema                 

現時点では、この結果の関係に正規化を適用する方法がわかりません。私が探しているのは、段階的な正規化です。最終結果は必要ありません。これには段階的なテーブルの正規化が必要なので、正規化ルールを学びたくありません。

4

1 に答える 1

1

これが 3NF になりますが、制約をテストしていません。

映画(名前、年)
PK > (名前、年)

評論家(ID、名前)
PK > ID

film_critic (映画名、映画年、批評家 ID、スコア)
PK > (フィルム名、フィルム年、批評家 ID)
FK > (フィルム名、フィルム年) & 批評家 ID

シネマ(名前)
PK > 名前

film_cinema (フィルム名、フィルム年、シネマ名)
PK > (フィルム名、フィルム年、シネマ名)
FK > (映画名、映画年) & 映画館名

映画の名前と年を参照する代わりに、代理キーを使用する方が簡単です (映画の場合も同様です)。

映画(ID、名前、年)
PK > ID

評論家(ID、名前)
PK > ID

film_critic (フィルム ID、批評家 ID、スコア)
PK > (フィルム ID、批評家 ID)
FK > 映画 ID & 評論家 ID

シネマ(ID、名前)
PK > ID

film_cinema (フィルム ID、シネマ ID)
PK > (フィルム ID、シネマ ID)
FK > film_id & cinema_id
于 2012-12-03T15:39:44.790 に答える