As mentioned a database field is a container for a single piece of data such as a surname, a price or a number. Each of those examples is a different type of data. They could all be stored as text but there are advantages to making sure they are held as what they are. The most common types of field have these attributes:
- text fields will hold a number of characters (any symbol on the keyboard and more) and will have a length limit
- numeric fields will hold just numbers, may allow positive and negative or just positive and will have a limit based on binary digits (e.g. -128 to +127 or 0 to 65,535)
- date fields will hold either date format data (e.g. 12/04/2008) or the number of seconds since a fixed start date
The general rule is to use the smallest and simplest field which will successfully hold your data. For example, when storing a person's first name where the longest likely content is maybe 20-30 characters don't allocate 50 characters as this will waste space in the database and slow it down as well. If the numbers you want to hold cannot be negative then make sure you use an unsigned data type as then the upper limit will be higher (or maybe you can use a smaller data type). If numbers will always be whole (no decimal points) then there is no need to use floating point or decimal field types (float, single, double etc.).



