3. Why might we want to code data?

This is a good question, why is it often a good idea to code data?

Well much of the data that we collected and enter into our systems has some degree of repetition.

Speeding up data entry

Let's take the example of collecting data about a person's gender. People can be either 'Male' or 'Female'.

Whilst these two options are easily understood by all, imagine having to enter them into a system many hundreds of times.

Although each individual instance doesn't take long to enter, if you are paying someone to enter data then the old saying 'time is money' is very true.

Increase accuracy of data entry

The other issue is that no matter how accurate a person is at data entry, at some stage they are likely to make a mistake and might spell 'Male' as 'Mail' or 'Female' as 'Femal'. This type of mistake will make any results from your database queries unreliable.

Instead of entering 'Male' or 'Female' you could code the data and instead enter it as 'M' or 'F'.

Simply having to enter one letter instead of a possible six will speed up data entry. It will also cut down on the risk of mistakes being made with spelling.

Use of validation

In our example, the words 'Male' or 'Female' have been coded so that they become 'M' or 'F'.

When data has been coded it makes it easier to use validation to check if the data entered is sensible. With the example above, the person entering the data could still make a mistake and enter 'S' instead of 'M' or 'F'.

But if you set up validation so that the field will only accept the letters 'M' or 'F' and absolutely nothing else then that should further cut down on possible mistakes.

Note that validation can only check if the data is sensible and within reasonable limits, it cannot check whether the data is accurate. Somebody could still enter 'F' instead of 'M'.

Less storage space required

Every letter that you store in your database system will take one byte of storage. If you store 'Female' as 'F' then you will save five bytes of storage space. If the system belongs to a large organisation, there might be many thousands of records stored - simply by coding one field, a huge amount of expensive hard disk storage can be saved.

Faster searching for data

It stands to reason that the smaller the size of your database, the faster it will be to search and produce results.

Thus by coding data and keeping the size of the system to a minimum the more time you can save in the long run when running queries.

 

challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Coding Data Advantages