Selecting the Most Appropriate Data Type


Choosing the data type best suited to the values you expect to enter into the Corresponding field is extremely important. When making this decision, take into account the following factors:


The range and type of values that the field will hold
The types of calculations you expect to perform on those values
The manner in which the data is to be formatted for display purposes
The manner in which the data is to be sorted and compared against other fields
The available subtypes for each field and their storage efficiencies
By taking all these factors into consideration at the time of designing your database, you reduce the chance of incompatibilities and storage inefficiencies later. Using the wrong data type can affect both the performance of your RDBMS and the types of operations you can perform on that field. For example, using a VARCHAR type on a field that is meant for numeric or date values could result in unexpected behavior when you perform calculations on it, just as using a large TEXT field for small string values could lead to a waste of space and inefficient indexing.