There are two functional dependencies in the SQL databases.
a) Partial functional dependency: A non-key column is dependent on some, but not all of the columns in a composite primary key.
b) Transitive functional dependencies: Any non-key column depends on other non-key columns.
For a good SQL database.
Rule 1: Columns contain only atomic values
Rule 2: No repeating groups of data
Rule 3: Have no partial dependencies
Rule 4: having no transiti开发者_JAVA百科ve dependencies
I've understood the requirements of the 1 and 2nd rules, why do we need the 3rd and 4th rules, instead of saying the no column shouldn't depend on other columns. Why is there two separate rules (3 and 4)?
Source: Head First SQL
Thanks in advance!
Good question. It is purely for historical and pedagogical reasons that these two are often separated.
Second Normal Form (2NF) is concerned with eliminating only partial key dependencies. 2NF alone normally isn't especially important because the Third Normal Form, Boyce Codd Normal Form and higher normal forms also eliminate those same partial key dependencies and those NFs (> 2NF) are usually the desired goal in database design. However, it is common practice to teach normalization using a process of decomposition. By the decomposition method, partial key dependencies are usually considered first. In reality this is rarely done by most practioners who will often consider all dependencies at once.
Definitions of Normal Forms higher than 2NF don't necessarily mention partial key dependencies as a special case at all. Boyce Codd Normal Form can be briefly summarised as meaning that every non-trivial functional determinant is a superkey - in other words, no non-trivial FDs (of any kind) on anything other than keys.
精彩评论