3. Reasons to code data

entering dataIt is common for much of the data collected and entered into a system to have some degree of repetition and redundancy i.e. extra information that does not add anything.

And this pattern or repetition is why it is efficient to code the data in some way.

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 the word 'Male' and 'Female' into a system many hundreds of times. It is a waste of time and effort because no extra information is contained in the full words compared to a single letter.

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 at least 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 or millions of records stored - simply by coding one field, a huge amount of 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.

Summary: Reasons for coding
  • Speeding up data entry
  • Increase accuracy of data entry
  • Use of validation
  • Less storage space required
  • Faster searching for data

 

 

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