Data Types for MariaDB Community Server 10.6
This page is part of MariaDB's Documentation.
The parent of this page is: Reference for MariaDB Community Server 10.6
Topics on this page:
Overview
Each column in a table has a specified data type that defines what kind of data can be stored in the column.
Integer Numeric Types
Data Type | Class | Description |
---|---|---|
Integer | Integer from -9223372036854775808 to 9223372036854775807 when signed, or from 0 to 18446744073709551615 when unsigned | |
Bit | Bit data | |
Integer | See TINYINT | |
Integer | See TINYINT | |
Integer | Integer from -2147483648 to 2147483647 when signed, or from 0 to 4294967295 when unsigned | |
Integer | See TINYINT | |
Integer | See SMALLINT | |
Integer | See MEDIUMINT | |
Integer | See INT | |
Integer | See BIGINT | |
Integer | See INT | |
Integer | Integer from -8388608 to 8388607 when signed, or from 0 to 16777215 when unsigned | |
Integer | See MEDIUMINT | |
Alias | This is an alias for | |
Integer | Integer from -32768 to 32767 when signed, or from 0 to 65535 when unsigned | |
Integer | Integer from -128 to 127 when signed, or from 0 to 255 when unsigned |
Non-integer Numeric Types
Data Type | Class | Description |
---|---|---|
Fixed Num | See DECIMAL | |
Fixed Num | Fixed-point number | |
Float | Double-precision floating-point number | |
Float | See DOUBLE | |
Fixed Num | See DECIMAL | |
Float | Single-precision floating-point number | |
Float | See FLOAT | |
Float | See DOUBLE | |
SQL/PL | See DECIMAL | |
Fixed Num | See DECIMAL | |
Float | See DOUBLE |
String Types
Data Type | Class | Description |
---|---|---|
String | Fixed-length string for binary data with limit up to 255 bytes | |
String | String for variable-length binary data up to 65,535 bytes | |
String | Fixed-length string with limit up to 255 bytes | |
String | See BINARY | |
String | See VARCHAR | |
String | See CHAR | |
String | See VARCHAR | |
SQL/PL | See LONGTEXT | |
Binary | Stores an INET6 or mapped INET4 network address as a BINARY(16) internally while translating it into a CHAR(39) to the user | |
String | An alias of LONGTEXT with a default | |
String | See MEDIUMTEXT | |
String | See MEDIUMTEXT | |
String | See MEDIUMTEXT | |
String | See MEDIUMBLOB | |
String | See MEDIUMTEXT | |
String | See MEDIUMTEXT | |
String | String for variable-length binary data up to 4,294,967,295 bytes | |
String | String for variable-length text data up to 4,294,967,295 bytes | |
String | String for variable-length binary data up to 16,777,215 bytes | |
String | String for variable-length text data up to 16,777,215 bytes | |
String | Fixed-length string of specific character set with limit up to 255 bytes | |
String | See NATIONAL VARCHAR | |
String | See NATIONAL CHAR | |
String | See NATIONAL VARCHAR | |
String | Variable-length string of specific character set with limit up to 65,535 bytes | |
String | See NATIONAL VARCHAR | |
String | See NATIONAL CHAR | |
String | See NATIONAL VARCHAR | |
String | See NATIONAL VARCHAR | |
String | See NATIONAL VARCHAR | |
String | See NATIONAL VARCHAR | |
SQL/PL | See VARBINARY | |
String | String for variable-length text data up to 65,535 bytes | |
String | String for variable-length binary data up to 255 bytes | |
String | String for variable-length text data up to 255 bytes | |
String | Variable-length string for binary data with limit up to 65,535 bytes | |
String | Variable-length string with limit up to 65,535 bytes | |
SQL/PL | See VARCHAR | |
String | See VARCHAR |
Date & Time Types
Data Type | Class | Description |
---|---|---|
Date | Year, month, day | |
SQL/PL | See DATETIME | |
Date/Time | Year (1000-9999), month, day, hours, minutes, seconds | |
Date | See YEAR | |
Time | Hours, minutes, seconds | |
Date/Time | Accepts a datetime value consisting of year (1970-2038), month, day, hours, minutes, seconds, and microseconds | |
Date | Two-digit or four-digit year |
Geometry Types
Data Type | Class | Description |
---|---|---|
Geometry | Accepts collection data; and point, line, polygon single or multi | |
Geometry | WKB Geometry Collection | |
Geometry | WKB LineString from WKB Point coordinate data | |
Geometry | WKB MultiLineString from WKB LineString data | |
Geometry | WKB MultiPoint from WKB Point coordinate data | |
Geometry | WKB MultiPolygon from WKB Polygon data | |
Geometry | WKB Point coordinate data | |
Geometry | WKB Polygon from WKB LineString data |
Other Types
Data Type | Class | Description |
---|---|---|
Set | A single value from up to 65,535 pre-selected options | |
SQL/PSM | This declaration is only available inside a stored procedure | |
SQL/PSM | This is special declaration only available inside a stored procedure | |
Set | One or more comma-separated values from a set of up to 64 pre-selected options | |
SQL/PSM | This is special declaration only available inside a stored procedure |