3576
3576
Database data types refer to the format of data storage that can hold a distinct type or range of
values. When computer programs store data in variables, each variable must be designated a distinct
data type. Some common data types are as follows: integers, characters, strings, floating-point
numbers and arrays. More specific data types are as follows: varchar (variable character) formats,
Boolean values, dates and timestamps.
There are programming languages that require the programmer to determine the data type of a
variable before attaching a value to it. While some programming languages can automatically attach a
data type to a variable based on the initial data assigned to the variable. For example, a variable is
assigned with the value “3.75”, then the data type that will be attached to the variable is floating
point.
Most of the programming languages enable each variable to store only a single data type. For
example, if the data type attached to the variable is integer, when you assign a string data to the
variable, the string data will be converted to an integer format.
Database applications use data types. Database fields require distinct type of data to be entered. For
example, school record for a student may use a string data type for student’s first and last name. The
student’s date of birth would be stored in a date format and the student’s GPA can be stored as
decimal. By ensuring that the data types are consistent across multiple records, database applications
can easily perform calculations, comparisons, searching and sorting of fields in different records.