In a previous article I discussed First Normal Form. I have also mentioned elsewhere that the shorthand version of database normalisation is to ensure that the database is dependant upon the key, the whole key, and nothing but the key, so help me Codd. First Normal Form is ensuring that the data is dependant upon the key.

Second Normal Form, or 2NF, is ensuring that the data in any table is dependent upon the whole key. That is, a table, or stricly a relation, is in Second Normal Form if it is in 1NF (First Normal Form) and evey on-key attribute is dependent upon the primary key.

The classic example of this is often given as a table for Parts provided by a number of Suppliers. A particular Part can be supplied by a number of different suppliers, so the key to the table is a composite key made up of Part Number and Supplier Number.

What is important to note is that only data that is dependant upon both elements of the key, that is Part Number, and Supplier Number, belong in the table. You would not put Part Description in the table, because that is only dependent upon the Part Number. Similary, the Supplier Address would be in the Supplier table. However, Price would go in this Parts_Supplier table because different suppliers are likely to chage different amounts for the same parts.

In summary, when an item of data is dependent upon more than one key then it needs to go into a table with a composite key. But, to be in 2NF all the data needs to be dependent upon the entire composite key.