data-types-for-mariadb-community-server-10-5

Data Types for MariaDB Community Server 10.5

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

Data Type

Class

Description

Integer

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

Bit

Bit data

Integer

Integer

Integer

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

Integer

Integer

[

INT3](../data-types-numeric-data-types/int3.md)

Integer

Integer

See INT

Integer

See BIGINT

Integer

See INT

Integer

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

Alias

This is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE

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

Data Type

Class

Description

Fixed Num

Fixed Num

Fixed-point number

Float

Double-precision floating-point number

Fixed Num

Float

Single-precision floating-point number

Float

See FLOAT

Float

See DOUBLE

SQL/PL

Fixed Num

Float

See DOUBLE

String Types

Data Type
Class
Description

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 CHAR

SQL/PL

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 json_valid() CHECK (check added in MariaDB Community Server 10.4.3)

String

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

Variable-length string of specific character set with limit up to 65,535 bytes

SQL/PL

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

Date & Time Types

Data Type
Class
Description

Data Type

Class

Description

Date

Year, month, day

Date/Time

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

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

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

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

This page is: Copyright © 2025 MariaDB. All rights reserved.

Last updated

Was this helpful?