Documentation

MySQL common Data Types

Below a table of commonly used MySQL data types. When you are mapping field values to database columns, make sure the field value matches the format of the database column.

Data TypeDescriptionExample Value
TINYINTSmall integer value.127
INTStandard integer value.2147483647
BIGINTLarge integer value.9223372036854775807
FLOATSmall floating-point number.3.14159
DOUBLELarge floating-point number with precision.2.718281828459045
DECIMALExact numeric data type suitable for high-precision arithmetic.12345.67
DATEDate value in ‘YYYY-MM-DD’ format.2023-10-06
DATETIMECombination of date and time.2023-10-30 13:45:00
TIMESTAMPMySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME.) By default, the current time zone for each connection is the server’s time.2023-10-30 13:45:00
CHARFixed-length character string.'A''Hello'
VARCHARVariable-length character string.'Hello World!'
BLOBBinary large object for storing binary data.[binary data]
TEXTTextual data up to a maximum length.'Sample text here.'
ENUMEnumeration; string object that can have only one value, chosen from a list of allowed values.'small' or 'medium'
SETA set; similar to ENUM but can hold multiple values.'a,b,c'
JSONStores JSON formatted data.'{"key": "value"}'

For further reading we recommend the MariaDB knowledge base about Data Types.

Entry to Database1.0

For this functionality to work you need to install the GravityWP - Entry to database Add-on.

Read more