Data Types

Data Types in MariaDB

Title Description

Numeric Data Types

Title Description
Numeric Data Type Overview Overview and usage of the numeric data types
TINYINT Tiny integer, -128 to 127 signed
BOOLEAN Synonym for TINYINT(1)
SMALLINT Small integer from -32768 to 32767 signed
MEDIUMINT Medium integer from -8388608 to 8388607 signed
INT Integer from -2147483648 to 2147483647 signed
INTEGER Synonym for INT
BIGINT Large integer
DECIMAL A packed "exact" fixed-point number.
FLOAT Single-precision floating-point number
DOUBLE Normal-size (double-precision) floating-point number
BIT Bit field type
Floating-point Accuracy Not all floating-point numbers can be stored with exact precision

String Data Types

Title Description
String Literals Strings are sequences of characters and are enclosed with quotes.
CHAR Fixed-length string.
VARCHAR Variable-length string.
BINARY Fixed-length binary byte string.
VARBINARY Variable-length binary byte string.
TINYBLOB Tiny binary large object up to 255 bytes.
BLOB Binary large object up to 65,535 bytes.
BLOB and TEXT Data Types Binary large object data types and the corresponding TEXT types.
MEDIUMBLOB Medium binary large object up to 16,777,215 bytes.
LONGBLOB Long BLOB holding up to 4GB.
TINYTEXT A TEXT column with a maximum length of 255 characters.
TEXT A TEXT column with a maximum length of 65,535 characters.
MEDIUMTEXT A TEXT column with a maximum length of 16,777,215 characters.
LONGTEXT A TEXT column with a maximum length of 4,294,967,295 characters.
JSON Data Type Compatibility data type that is an alias for LONGTEXT.
ENUM Enumeration, or string object that can have one value chosen from a list of values.
SET Data Type Set, or string object that can have 0 or more values chosen from a list of values.
Supported Character Sets and Collations MariaDB supports the following character sets and collations.
Character Sets and Collations Setting character set and collation for a language.
Data Type Storage Requirements Storage requirements for the various data types.
ROW Data type for stored procedure variables.

Date and Time Data Types

Title Description
DATE The date type YYYY-MM-DD
TIME Time format HH:MM:SS.ssssss
DATETIME Date and time combination displayed as YYYY-MM-DD HH:MM:SS.
YEAR Data Type A four-digit year
Future developments for temporal types My current project is a forecasting application with dates going out to 263...
How to define a date in order to import an empty date from a CSV file? I have a CSV file containing amongst other things a couple of date columns....
Which datatypes are supported by MariaDB I would like to know which datatypes are supported by MariaDB. I'm asking s...

Other Data Types Articles

Title Description
Geometry Types Supported geometry types
AUTO_INCREMENT Automatic increment.
Data Type Storage Requirements Storage requirements for the various data types.
AUTO_INCREMENT FAQ Frequently-asked questions about auto_increment.
NULL Values NULL represents an unknown value.
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.