Data Types for MariaDB Xpand 6.0

Overview

Each column in a table has a specified data type that defines what kind of data can be stored in the column.

Data Type

Class

Description

TINYINT

Integer

Integer from -128 to 127 when signed, or from 0 to 255 when unsigned

SMALLINT

Integer

Integer from -32768 to 32767 when signed, or from 0 to 65535 when unsigned

MEDIUMINT

Integer

Integer from -8388608 to 8388607 when signed, or from 0 to 16777215 when unsigned

INT

Integer

Integer from -2147483648 to 2147483647 when signed, or from 0 to 4294967295 when unsigned

BIGINT

Integer

Integer from -9223372036854775808 to 9223372036854775807 when signed, or from 0 to 18446744073709551615 when unsigned

DECIMAL

Fixed Num

Fixed-point number

FLOAT

Float

Single-precision floating-point number

DOUBLE

Float

Double-precision floating-point number

CHAR

String

Fixed-length string with limit up to 1023 bytes

VARCHAR

String

Variable-length string with limit up to 65,535 bytes

TINYTEXT

String

String for variable-length text data up to 255 bytes

TEXT

String

String for variable-length text data up to 65,535 bytes

MEDIUMTEXT

String

String for variable-length text data up to 16,777,215 bytes

LONGTEXT

String

String for variable-length text data up to 67,108,864 bytes

TINYBLOB

String

String for variable-length binary data up to 255 bytes

BLOB

String

String for variable-length binary data up to 65,535 bytes

MEDIUMBLOB

String

String for variable-length binary data up to 16,777,215 bytes

LONGBLOB

String

String for variable-length binary data up to 67,108,864 bytes

BINARY

String

Fixed-length string for binary data with limit up to 255 bytes

VARBINARY

String

Variable-length string for binary data with limit up to 65,535 bytes

BIT

Bit

Bit data

SET

Set

One or more comma-separated values from a set of up to 64 pre-selected options

ENUM

Set

A single value from up to 65,535 pre-selected options

TIME

Time

Hours, minutes, seconds, and microseconds

YEAR

Date

Four-digit year

DATE

Date

Year, month, day

TIMESTAMP

Date/Time

Year, month, day, hours, minutes, seconds, and microseconds, and supporting dates between the years 1970 and 2038

DATETIME

Date/Time

Year, month, day, hours, minutes, seconds, and microseconds, and supporting dates between the years 1000 and 9999

JSON

String

A native JSON data type that converts the assigned value into an internal JSON representation

SERIAL

Alias

This is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE

NATIONAL CHAR

String

See CHAR

DEC

Fixed Num

See DECIMAL

NUMERIC

Fixed Num

See DECIMAL

DOUBLE PRECISION

Float

See DOUBLE

REAL

Float

See DOUBLE

BOOL

Integer

See TINYINT

BOOLEAN

Integer

See TINYINT

INT1

Integer

See TINYINT

INT2

Integer

See SMALLINT

INT3

Integer

See MEDIUMINT

INT4

Integer

See INT

INTEGER

Integer

See INT

INT8

Integer

See BIGINT

NATIONAL CHARACTER

String

See CHAR

NCHAR

String

See CHAR

CHARACTER

String

See CHAR