Data Types for MariaDB Xpand 5.3

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

BIGINT

Integer

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

BIT

Bit

Bit data

BOOL

Integer

See TINYINT

BOOLEAN

Integer

See TINYINT

INT

Integer

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

INT1

Integer

See TINYINT

INT2

Integer

See SMALLINT

INT3

Integer

See MEDIUMINT

INT4

Integer

See INT

INT8

Integer

See BIGINT

INTEGER

Integer

See INT

MEDIUMINT

Integer

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

SERIAL

Alias

This is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE

SMALLINT

Integer

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

TINYINT

Integer

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

Non-integer Numeric Types

Data Type

Class

Description

DEC

Fixed Num

See DECIMAL

DECIMAL

Fixed Num

Fixed-point number

DOUBLE

Float

Double-precision floating-point number

DOUBLE PRECISION

Float

See DOUBLE

FLOAT

Float

Single-precision floating-point number

NUMERIC

Fixed Num

See DECIMAL

REAL

Float

See DOUBLE

String Types

Data Type

Class

Description

BINARY

String

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

BLOB

String

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

CHAR

String

Fixed-length string with limit up to 1023 bytes

CHARACTER

String

See CHAR

JSON

String

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

LONGBLOB

String

String for variable-length binary data

LONGTEXT

String

String for variable-length text data

MEDIUMBLOB

String

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

MEDIUMTEXT

String

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

NATIONAL CHAR

String

See CHAR

NATIONAL CHARACTER

String

See CHAR

NCHAR

String

See CHAR

TEXT

String

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

TINYBLOB

String

String for variable-length binary data up to 255 bytes

TINYTEXT

String

String for variable-length text data up to 255 bytes

VARBINARY

String

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

VARCHAR

String

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

Date & Time Types

Data Type

Class

Description

DATE

Date

Year, month, day

DATETIME

Date/Time

Year (1000-9999), month, day, hours, minutes, seconds

TIME

Time

Hours, minutes, seconds, and microseconds

TIMESTAMP

Date/Time

Accepts a datetime value consisting of year (1970-2038), month, day, hours, minutes, seconds, and microseconds

YEAR

Date

Four-digit year

Other Types

Data Type

Class

Description

ENUM

Set

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

SET

Set

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