Data Types
Data Types in MariaDB
Numeric Data Types
-
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. -
DEC, NUMERIC, FIXED
Synonyms for DECIMAL -
NUMBER
Synonym for DECIMAL in Oracle mode. -
FLOAT
Single-precision floating-point number -
DOUBLE
Normal-size (double-precision) floating-point number -
DOUBLE PRECISION
REAL and DOUBLE PRECISION are synonyms for DOUBLE. -
BIT
Bit field type. -
VECTOR
Vector data type. -
Floating-point Accuracy
Not all floating-point numbers can be stored with exact precision -
INT1
A synonym for TINYINT. -
INT2
Synonym for SMALLINT. -
INT3
Synonym for MEDIUMINT. -
INT4
Synonym for INT. -
INT8
Synonym for BIGINT. -
BOOL
Overview See TINYINT. EXAMPLES CREATE TABLE bool_example ( example BOOL ... -
DEC
See DECIMAL. EXAMPLES CREATE TABLE dec_example ( example DEC ); SHOW CRE... -
FIXED
Overview See DECIMAL. EXAMPLES CREATE TABLE fixed_example ( example FIXED ); SHOW CREATE -
FLOAT4
Overview See FLOAT. EXAMPLES CREATE TABLE float4_example ( example FLOAT... -
FLOAT8
Overview See DOUBLE. EXAMPLES CREATE TABLE float8_example ( example FLOAT8 ); SHOW CREAT -
MIDDLEINT
Overview See MEDIUMINT. EXAMPLES CREATE TABLE middleint_example ( example MIDDLEINT ); S -
NUMERIC
Overview See DECIMAL. EXAMPLES CREATE TABLE numeric_example ( example NUMERIC ); SHOW CR -
REAL
Overview See DOUBLE. EXAMPLES CREATE TABLE real_example ( example REAL ...
String Data Types
-
String Literals
under: » MariaDB Server Documentation » Using MariaDB Server » SQL Statements & Structure » SQL Language StructureStrings are sequences of characters and are enclosed with quotes. -
BINARY
Fixed-length binary byte string. -
BLOB
Binary large object up to 65,535 bytes. -
BLOB and TEXT Data Types
Binary large object data types and the corresponding TEXT types. -
CHAR
Fixed-length string. -
CHAR BYTE
Alias for BINARY. -
ENUM
Enumeration, or string object that can have one value chosen from a list of values. -
INET4
For storage of IPv4 addresses. -
INET6
For storage of IPv6 addresses. -
JSON Data Type
Compatibility data type that is an alias for LONGTEXT. -
MEDIUMBLOB
Medium binary large object up to 16,777,215 bytes. -
MEDIUMTEXT
A TEXT column with a maximum length of 16,777,215 characters. -
LONGBLOB
Long BLOB holding up to 4GB. -
LONG and LONG VARCHAR
LONG and LONG VARCHAR are synonyms for MEDIUMTEXT. -
LONGTEXT
A TEXT column with a maximum length of 4,294,967,295 characters. -
ROW
Data type for stored procedure variables. -
TEXT
A TEXT column with a maximum length of 65,535 characters. -
TINYBLOB
Tiny binary large object up to 255 bytes. -
TINYTEXT
A TEXT column with a maximum length of 255 characters. -
VARBINARY
Variable-length binary byte string. -
VARCHAR
Variable-length string. -
SET Data Type
Set, or string object that can have 0 or more values chosen from a list of values. -
UUID Data Type
Data type intended for the storage of UUID data. -
Data Type Storage Requirements
under: » MariaDB Server Documentation » Columns, Storage Engines, and Plugins » Data TypesStorage requirements for the various data types. -
Supported Character Sets and Collations
under: » MariaDB Server Documentation » Columns, Storage Engines, and Plugins » Data Types » String Data Types » Character Sets and CollationsMariaDB supports the following character sets and collations. -
Character Sets and Collations
Setting character set and collation for a language. -
CHAR VARYING
Overview See VARCHAR. EXAMPLES CREATE TABLE char_varying_example ( examp... -
CHARACTER
Overview See CHAR. EXAMPLES CREATE TABLE character_example ( example CHA... -
CHARACTER VARYING
under:Overview See VARCHAR. EXAMPLES CREATE TABLE character_varying_example ( ... -
CLOB
Overview See LONGTEXT. EXAMPLES SET sql_mode='oracle'; CREATE TABLE clob_... -
LONG
under:Overview See MEDIUMTEXT. EXAMPLES CREATE TABLE long_example ( example LONG ); SHOW CREAT -
LONG CHAR VARYING
Overview See MEDIUMTEXT. EXAMPLES CREATE TABLE long_char_varying_example ... -
LONG CHARACTER VARYING
Overview See MEDIUMTEXT. EXAMPLES CREATE TABLE long_character_varying_exam... -
LONG VARBINARY
Overview See MEDIUMBLOB. EXAMPLES CREATE TABLE long_varbinary_example ( ... -
LONG VARCHAR
Overview See MEDIUMTEXT. EXAMPLES CREATE TABLE long_varchar_example ( e... -
LONG VARCHARACTER
Overview See MEDIUMTEXT. EXAMPLES CREATE TABLE long_varcharacter_example (... -
NATIONAL CHAR
Overview Fixed-length string of specific character set with limit up to 25... -
NATIONAL CHAR VARYING
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE national_char_varying... -
NATIONAL CHARACTER
Overview See NATIONAL CHAR. EXAMPLES CREATE TABLE national_character_examp... -
NATIONAL CHARACTER VARYING
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE national_character_va... -
NATIONAL VARCHAR
Overview Variable-length string of specific character set with limit up to... -
NATIONAL VARCHARACTER
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE national_varcharacter... -
NCHAR
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE nchar_example ( exa... -
NCHAR VARCHAR
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE nchar_varchar_example... -
NCHAR VARCHARACTER
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE nchar_varcharacter_ex... -
NCHAR VARYING
Overview See NATIONAL VARCHAR. EXAMPLES CREATE TABLE nchar_varying_example... -
RAW
Overview See VARBINARY. EXAMPLES SET sql_mode='oracle'; CREATE TABLE raw_e... -
VARCHAR2
Overview See VARCHAR. EXAMPLES SET sql_mode='oracle'; CREATE TABLE varcha... -
VARCHARACTER
Overview See VARCHAR. EXAMPLES CREATE TABLE varcharacter_example ( examp...
Date and Time Data Types
-
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. -
TIMESTAMP
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.... -
SQL_TSI_YEAR
Overview See YEAR. EXAMPLES CREATE TABLE sql_tsi_year_example ( example SQL_TSI_YEAR ); -
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
-
Data Types Overview
Data Types articles copied over from the Enterprise documentation -
Geometry Types
under: » MariaDB Server Documentation » Using MariaDB Server » SQL Statements & Structure » Geographic & Geometric FeaturesSupported 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. -
Server Versions
Articles copied over from the Enterprise docs -
Data Types for MariaDB Server
A summary of data types across MariaDB Server versions: Data TypeIn 11.4 E... -
ROW TYPE OF
Overview This is special declaration only available inside a stored proced... -
SERIAL
Overview This is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQ... -
TYPE OF
Overview This is special declaration only available inside a stored proced...
There are 8 related questions.
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.