In this post, we are going to learn all data types that are supported by MariaDB, categorized in three major groups: Numeric Data Types, Date and Time Data Types, and String Data Types.

1. Numeric Data Types

Name Description
TINYINT A small integer. The signed range of -128 to 127, and the unsigned range of 0 to 255.
BOOLEAN A value 0 with “false,” and a value 1 with “true.”
SMALLINT A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.
MEDIUMINT A medium-sized integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
INT(also INTEGER) A normal-sized integer. When marked as unsigned, the range spans 0 to 4294967295. When signed (the default setting), the range spans -2147483648 to 2147483647. When a column is set to ZEROFILL( an unsigned state), all its values are prepended by zeros to place M digits in the INT value.
BIGINT A large integer. The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615.
DECIMAL(m,d), also DEC, NUMERIC, FIXED A precise fixed-point number. m defaults to 10, if not specified. d defaults to 0, if not specified.
FLOAT(m,d) A small, floating-point number. Allowable values are:
-3.402823466E+38 to -1.175494351E-38
0
1.175494351E-38 to 3.402823466E+38.
DOUBLE also REAL and DOUBLE PRECISION A normal-size, floating-point numbers. Allowable values are:
-1.7976931348623157E+308 to -2.2250738585072014E-308
0
2.2250738585072014E-308 to 1.7976931348623157E+308
BIT[(m)] A bit-field type. m indicates the number of bits per value, from 1 to 64. The default is 1 if m is omitted.


2. Date and Time Data Types

Name Value range
DATE Values range from ‘1000-01-01’ to ‘9999-12-31’.
TIME Values range from ‘-838:59:59’ to ‘838:59:59’.
DATETIME Values range from ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’.
TIMESTAMP Values range from ‘1970-01-01 00:00:01’ UTC to ‘2038-01-19 03:14:07’ UTC.
YEAR Year value as 2 digits or 4 digits.


3. String DataTypes

Name Description
String literals The character sequences enclosed by quotes.
CHAR A right-padded, fixed-length string containing spaces of specified length.
VARCHAR A variable-length string, with an M range (maximum column length) of 0 to 65535.
BINARY A binary byte string, with M as the column length in bytes.
VARBINARY A binary byte string of variable length.
TINYBLOB A blob column with a maximum length of 255 (2^8 - 1) bytes.
BLOB A blob column with a maximum length of 65,535 (2^16 - 1) bytes.
MEDIUMBLOB A blob column with a maximum length of 16,777,215 (2^24 - 1) bytes.
LONGBLOB A blob column with a maximum length of 4,294,967,295(2^32 - 1) bytes.
TINYTEXT A text column with a maximum length of 255 (2^8- 1) characters.
TEXT A text column with a maximum length of 65,535 (2^16 - 1) characters.
MEDIUMTEXT A text column with a maximum length of 16,777,215 (2^24 - 1) characters.
LONGTEXT A text column with a maximum length of 4,294,967,295 or 4GB (2^32 - 1) characters.
ENUM A string object having only a single value from a list.
SET A string object having zero or more values from a list, with a maximum of 64 members. SET values present internally as integer values.

Looking for a good GUI tool to work with MariaDB database? Try TablePlus.

TablePlus is a modern, native client with intuitive GUI tools to create, access, query & edit multiple relational databases: MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Amazon Redshift, MariaDB, CockroachDB, Vertica, Cassandra, Oracle, and Redis.

It can’t be perfect for everone but perhaps you should try it yourself and see if it’s good for your database management tasks. It’s free anyway.

Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS.

TablePlus in Dark mode