Database design tutorial

The second normal form (2NF)

The second normal deals with data redundancy. The rules comprised in the second normal form are as follows.

By inpecting your tables you can identify data that is not dependent on the primary key of the table. You can identify such data by looking which table columns repeat data. The com_type field in the ContactMoments table is such a column. The values "telephone", "email" and "letter" are repeated in the column. This is called data redundancy and it can be avoided by using two separate tables. Below are the new Contact moments table and the new CommunicationTypes table.

Contact moments

com typesenlarge

CommunicationTypes

Communication types

The communication_type field of the ContactMoments table is linked to the com_type_id field in the CommunicationTypes table. A one-to-many relationship exists between communication types and contact moments. Each communication type can be linked to multiple contact moment records. Vice versa, each contact moment is associated with one communication type. There are some advantages to working this way.

The same applies to the inbound_outbound column. The words "inbound" and "outbound" are stored redundantly. If you want to adhere to the second normal form, you could split off inbound_outbound into a separate table that could for example be called CommunicationDirection. However, in this database design tutorial I will leave the inbound_outbound field in tact. The chances you want to add a new communication direction in the future are probably slim. Perhaps "internal" could be added in the future to accomodate for the registration of contact moments between employees, but let's not make this tutorial too lengthy.

On the next page of this database design tutorial I will dig into the third normal form.