Normalization

如何將表格轉換為第二範式

  • March 12, 2017

我真的很難將表格轉換為第二範式。我嘗試了一些更容易的例子,但是我似乎無法辨識這個鍵並繼續前進。我通過複製模組資訊將其轉換為第一範式。

在此處輸入圖像描述

1NF: Only the key
   Remove repeated data/data groups 
   i.e. having a person and address table instead of single mega-table
2NF: The whole key
   Ensure that all nonkey columns are dependent on the whole key
   So with a table where employee name and location could be a primary key, 
   and there is a skill attribute the skill attribute isn’t dependent 
   on the whole of the key as 
   it isn’t dependent on location therefore must be split into two tables
3NF And nothing but the key
   Should not have any dependencies on things other than the primary key

現在這似乎是一個家庭作業問題,所以我不會為你做,而是製作一個模組表,製作一個房間表。如果您想要使用第三範式製作預訂表,其中模組程式碼和房間號作為複合主鍵,以及與預訂相關的欄位。

請記住,規範化是使所有數據相關並消除重複。

引用自:https://dba.stackexchange.com/questions/44379