我有這個表,我必須正常化達到3NF正常化表
假設如下:
一個訂單可以包含多種產品
每當一個客戶下訂單,他們得到一個新的訂單號
一個訂單屬於一個且只有一個客戶
個訂單(ORDERNUM,訂購日期,(產品編號,ProductDesc),CUSTID,客戶名稱,CustomerAddress)
到目前爲止,我已經做到了這一點
1FN
Orders (OrderNum, OrderDate, (ProductId,ProductDesc),(CustId,CustomerName,CustomerAddress, OrderNum))
2FN
Orders(OrderNum, OrderDate)
Orders_Product(OrderNum, ProductId)
Product(ProductId, ProductDesc)
Customer_Orders(OrderNum, CustId)
Customer(CustId,CustomerName,CustomerAddress)
3 NF
個
的表已經完成3NF
Orders(OrderNum, OrderDate)
Orders_Product(OrderNum, ProductId)
Product(ProductId, ProductDesc)
Customer_Orders(OrderNum, CustId)
Customer(CustId,CustomerName,CustomerAddress)
依賴
OrderNum OrderDate,ProductId,ProductDesc,CustId, CustomerName, CustomerAddress
ProductId ProductDesc
CustId CustomerName, CustomerAddress
是我2NF和3NF是否正確?在定義
我認爲只有你的2NF是錯誤的。閱讀此:[第二範式](https://en.wikipedia.org/wiki/Second_normal_form) –
我不記得2NF應該是什麼樣子。但是,在你的3NF模型中,我不認爲你需要Customer_Orders表。您應該在訂單表上擁有一個CustId。 –
你爲什麼認爲他的2NF是錯的? – AnhTriet