6.3 Data types

Why are data types important?

It is important that the database knows what type of data it is using, for two main reasons. Firstly, data such as numbers is stored differently to text. Secondly, as a result of being stored differently, this determines what operations can be carried out on it.

Number need to be stored in such a way that arithmetic can be preformed efficiently. Dates need to be stored so that they can be referenced in order and have comparisons made between them. Some data is simply a ‘yes’ or ‘no’ type.

Before creating a database, it is vital that you have considered the fields in the record structure  and given each one its correct data type.

What data types are there? When do we use them?

12