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 Type | Description | Example Value |
---|---|---|
TINYINT | Small integer value. | 127 |
INT | Standard integer value. | 2147483647 |
BIGINT | Large integer value. | 9223372036854775807 |
FLOAT | Small floating-point number. | 3.14159 |
DOUBLE | Large floating-point number with precision. | 2.718281828459045 |
DECIMAL | Exact numeric data type suitable for high-precision arithmetic. | 12345.67 |
DATE | Date value in ‘YYYY-MM-DD’ format. | 2023-10-06 |
DATETIME | Combination of date and time. | 2023-10-30 13:45:00 |
TIMESTAMP | MySQL 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 |
CHAR | Fixed-length character string. | 'A' , 'Hello' |
VARCHAR | Variable-length character string. | 'Hello World!' |
BLOB | Binary large object for storing binary data. | [binary data] |
TEXT | Textual data up to a maximum length. | 'Sample text here.' |
ENUM | Enumeration; string object that can have only one value, chosen from a list of allowed values. | 'small' or 'medium' |
SET | A set; similar to ENUM but can hold multiple values. | 'a,b,c' |
JSON | Stores JSON formatted data. | '{"key": "value"}' |
For further reading we recommend the MariaDB knowledge base about Data Types.