tailieunhanh - ASP.NET 2.0 Everyday Apps For Dumies 2006 phần 2

Tham khảo tài liệu ' everyday apps for dumies 2006 phần 2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 26 Part I Introducing Application Development For example consider the following table in which the primary key is a combination of the Order Number and Product ID columns Line Items Order Number Product ID Name Quantity Price This table breaks 2NF because the Name column depends solely on the Product ID not on the combination of Order Number and Product ID. The solution is to remove the Name column from the Line Items table and retrieve the product name from the Products table whenever it s required. You might wonder whether the Price column also violates second normal form. The answer depends on the application s requirements. A product s price can change over time but the price for a given order should be the price that was effective when the order was created. So in a way the price does depend on the order number. Thus including the Price column in the Line Items table doesn t violate 2NF. Third normal form 3NF A table is in third normal form if every column in the table depends on the entire primary key and none of the non-key columns depend on each other. The Five Abby-Normal Forms No this stuff didn t come from an abnormal brain in a jar it only seems that way. In case you re interested and just to point out how esoteric these things can be here s a list of the original definitions of the five normal forms in the original Greek as formulated by C. J. Date in his classic book An Introduction to Database Systems Addison-Wesley 1974 First Normal Form 1NF A relation Ris in first normal form 1NF if and only if all underlying domains contain atomic values only. Second Normal Form 2NF A relation R is in second normal form 2NF if and only if it is in 1NF and every nonkey attribute is fully dependent on the primary key. Third Normal Form 3NF A relation Ris in third normal form 3NF if and only if it is in 2NF and every nonkey attribute is nontransitively dependent on the primary key. Fourth Normal Form 4NF A relation R is in fourth normal form 4NF if and .