# Data Types

- [Data Type Storage Requirements](https://mariadb.com/docs/server/reference/data-types/data-type-storage-requirements.md): Reference for storage space usage. This page lists the disk space consumed by each data type, helping with capacity planning and schema optimization.
- [AUTO\_INCREMENT](https://mariadb.com/docs/server/reference/data-types/auto_increment.md): Complete AUTO\_INCREMENT data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
- [AUTO\_INCREMENT FAQ](https://mariadb.com/docs/server/reference/data-types/auto_increment-faq.md): Answers to common questions about AUTO\_INCREMENT. Learn about gaps in sequences, resetting values, and behavior in different storage engines.
- [NULL Values](https://mariadb.com/docs/server/reference/data-types/null-values.md): Understand the concept of NULL. This page explains how NULL represents missing or unknown data and how it interacts with comparison operators and functions.
- [ROW TYPE OF](https://mariadb.com/docs/server/reference/data-types/row-type-of.md): Declare row-based variables. This PL/SQL compatibility feature allows declaring variables that match the structure of a table row or cursor.
- [SERIAL](https://mariadb.com/docs/server/reference/data-types/serial.md): Alias for BIGINT UNSIGNED NOT NULL AUTO\_INCREMENT UNIQUE. This shorthand data type is often used to define primary keys.
- [TYPE OF](https://mariadb.com/docs/server/reference/data-types/type-of.md): Declare variables based on existing types. This feature allows defining variables or parameters that inherit the data type of a table column or another variable.
- [Numeric Data Types](https://mariadb.com/docs/server/reference/data-types/numeric-data-types.md): Complete numeric types reference: INT/BIGINT ranges, DECIMAL(M,D) precision/scale, FLOAT/DOUBLE storage sizes, and numeric type selection guidelines.
- [Numeric Data Type Overview](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-type-overview.md): General introduction to numeric data types. This page summarizes the available integer, fixed-point, and floating-point types and their storage characteristics.
- [BIGINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bigint.md): Large integer type. A BIGINT uses 8 bytes and can store values from -9223372036854775808 to 9223372036854775807 (signed) or 0 to 18446744073709551615 (unsigned).
- [BIT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bit.md): Bit-field data type. A BIT(M) column stores M bits per value, allowing storage of binary values from 1 to 64 bits in length.
- [BOOL](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bool.md): Synonym for TINYINT(1). This type is commonly used to represent boolean values, where 0 is considered false and non-zero values are true.
- [BOOLEAN](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/boolean.md): Complete BOOLEAN type reference: TINYINT(1) synonym, TRUE/FALSE aliases, CREATE TABLE/SHOW CREATE TABLE output, and IF()/IS operator evaluation.
- [DEC, NUMERIC, FIXED](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/dec-numeric-fixed.md): Synonyms for DECIMAL. These keywords declare fixed-point numbers, which store exact numeric data with a defined precision and scale.
- [DEC](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric-data-types-dec.md): Synonym for DECIMAL. This keyword creates a fixed-point column with exact precision, suitable for financial calculations.
- [DECIMAL](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/decimal.md): Complete DECIMAL type reference: DECIMAL(M,D) syntax, precision limits (M≤65, D≤38), SIGNED/UNSIGNED/ZEROFILL options, and rounding behavior.
- [DOUBLE PRECISION](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double-precision.md): Synonym for DOUBLE. This keyword declares a normal-size (8-byte) floating-point number with double precision.
- [DOUBLE](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/double.md): Double precision floating-point number. A DOUBLE column uses 8 bytes to store large or precise approximate values.
- [FIXED](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/fixed.md): Synonym for DECIMAL. This keyword is used to define columns that require exact numeric precision, such as currency.
- [FLOAT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float.md): Single precision floating-point number. A FLOAT column uses 4 bytes and stores approximate values with less precision than DOUBLE.
- [FLOAT4](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float4.md): Synonym for FLOAT. This keyword declares a single-precision floating-point column.
- [FLOAT8](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/float8.md): Synonym for DOUBLE. This keyword declares a double-precision floating-point column.
- [Floating-point Accuracy](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/floating-point-accuracy.md): Explanation of floating-point precision issues. This page details why FLOAT and DOUBLE types are approximate and how rounding errors occur.
- [INT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int.md): Complete INT type reference: INT(M) syntax, signed (-2147483648 to 2147483647) vs unsigned (0 to 4294967295) ranges, and ZEROFILL padding guidelines.
- [INT1](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int1.md): Synonym for TINYINT. This type uses 1 byte of storage.
- [INT2](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int2.md): Synonym for SMALLINT. This type uses 2 bytes of storage.
- [INT3](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int3.md): Synonym for MEDIUMINT. This type uses 3 bytes of storage.
- [INT4](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int4.md): Synonym for INT. This type uses 4 bytes of storage.
- [INT8](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int8.md): Synonym for BIGINT. This type uses 8 bytes of storage.
- [INTEGER](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/integer.md): Synonym for INT. This keyword declares a standard 4-byte integer column.
- [MEDIUMINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/mediumint.md): Medium-sized integer. A MEDIUMINT column uses 3 bytes and stores values from -8388608 to 8388607 (signed) or 0 to 16777215 (unsigned).
- [MIDDLEINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/middleint.md): Synonym for MEDIUMINT. This keyword refers to the 3-byte integer type.
- [NUMBER](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/number.md): Oracle-compatible synonym for DECIMAL. This type is used for fixed-point arithmetic.
- [NUMERIC](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/numeric.md): Synonym for DECIMAL. This type stores exact numeric data values.
- [REAL](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/real.md): Synonym for DOUBLE. In standard SQL mode, REAL is a double-precision floating-point number.
- [SMALLINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/smallint.md): Small integer type. A SMALLINT column uses 2 bytes and stores values from -32768 to 32767 (signed) or 0 to 65535 (unsigned).
- [TINYINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/tinyint.md): Very small integer type. A TINYINT column uses 1 byte and stores values from -128 to 127 (signed) or 0 to 255 (unsigned).
- [Date and Time Data Types](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types.md): Store temporal values. This section covers data types for dates, times, and timestamps, including DATE, DATETIME, TIMESTAMP, TIME, and YEAR.
- [DATE](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/date.md): Complete DATE type reference: YYYY-MM-DD format, YYMMDD input literals, date range 1000-01-01 to 9999-12-31, and zero-date SQL\_MODE handling.
- [DATETIME](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/datetime.md): Complete DATETIME data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
- [SQL\_TSI\_YEAR](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/sql_tsi_year.md): Synonym for YEAR. This keyword is an alias used for declaring a column to store year values.
- [TIME](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/time.md): Store time values. This type handles time durations or time of day, ranging from '-838:59:59' to '838:59:59' with optional microsecond precision.
- [TIMESTAMP](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/timestamp.md): Complete TIMESTAMP data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
- [YEAR Data Type](https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/year-data-type.md): Store year values. This type stores a year in 2-digit or 4-digit format, supporting values from 1901 to 2155, and 0000.
- [String Data Types](https://mariadb.com/docs/server/reference/data-types/string-data-types.md): Store text and binary data. This section covers character types like CHAR, VARCHAR, and TEXT, as well as binary types like BLOB and BINARY.
- [BLOB and TEXT Data Types](https://mariadb.com/docs/server/reference/data-types/string-data-types/blob-and-text-data-types.md): Overview of large object types. This page compares BLOB (binary) and TEXT (character) types, explaining their storage and usage differences.
- [BINARY](https://mariadb.com/docs/server/reference/data-types/string-data-types/binary.md): Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.
- [BLOB](https://mariadb.com/docs/server/reference/data-types/string-data-types/blob.md): Variable-length binary large object. BLOB columns can store binary data up to 65,535 bytes, suitable for images or other non-text files.
- [CHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/char.md): Fixed-length character string type. CHAR columns store strings of a specified length (0 to 255), padding with spaces if necessary.
- [CHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/character.md): Fixed-length character string type. CHARACTER columns store strings of a specified length (0 to 255), padding with spaces if necessary.
- [CHAR BYTE](https://mariadb.com/docs/server/reference/data-types/string-data-types/char-byte.md): Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.
- [CHAR VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/char-varying.md)
- [CLOB](https://mariadb.com/docs/server/reference/data-types/string-data-types/clob.md): In Oracle mode, CLOB is an alias for the LONGTEXT data type used to store large text objects.
- [ENUM](https://mariadb.com/docs/server/reference/data-types/string-data-types/enum.md): Complete ENUM type reference: ENUM('v1','v2') syntax, CHARACTER SET/COLLATE options, NULL/empty string defaults, and numeric index sorting guidelines.
- [INET4](https://mariadb.com/docs/server/reference/data-types/string-data-types/inet4.md): IPv4 address data type. Stores IPv4 addresses as 4-byte binary strings for efficient storage and retrieval.
- [INET6](https://mariadb.com/docs/server/reference/data-types/string-data-types/inet6.md): IPv6 address data type. Stores IPv6 addresses as 16-byte binary strings, also supporting IPv4 addresses via mapping.
- [JSON Data Type](https://mariadb.com/docs/server/reference/data-types/string-data-types/json.md): Complete JSON Data Type data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
- [LONG and LONG VARCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-and-long-varchar.md): LONG and LONG VARCHAR are compatibility synonyms for the MEDIUMTEXT string data type.
- [LONG CHAR VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-char-varying.md): LONG CHAR VARYING is a compatibility synonym for the MEDIUMTEXT string data type.
- [LONG CHARACTER VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-character-varying.md): LONG CHARACTER VARYING is a compatibility synonym for the MEDIUMTEXT string data type.
- [LONG VARBINARY](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varbinary.md): LONG VARBINARY is a compatibility synonym for the MEDIUMBLOB binary data type.
- [LONG VARCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varchar.md): LONG VARCHAR is a compatibility synonym for the MEDIUMTEXT string data type.
- [LONG VARCHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/long-varcharacter.md): LONG VARCHARACTER is a compatibility synonym for the MEDIUMTEXT string data type.
- [LONGBLOB](https://mariadb.com/docs/server/reference/data-types/string-data-types/longblob.md): Very large binary object. A LONGBLOB column can store up to 4GB of binary data.
- [LONGTEXT](https://mariadb.com/docs/server/reference/data-types/string-data-types/longtext.md): Complete LONGTEXT type reference: 4GB (2^32-1) storage limit, CHARACTER SET/COLLATE syntax, max\_allowed\_packet constraints, and JSON/CLOB aliases.
- [MEDIUMBLOB](https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumblob.md): Medium-sized binary object. A MEDIUMBLOB column can store up to 16MB of binary data.
- [MEDIUMTEXT](https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumtext.md): Medium-sized character string. A MEDIUMTEXT column can store up to 16MB of text data.
- [NATIONAL CHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char.md): NATIONAL CHAR is a synonym for the CHAR data type that uses the predefined utf8 character set.
- [NATIONAL CHAR VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-char-varying.md): NATIONAL CHAR VARYING is a synonym for VARCHAR that uses the predefined utf8 character set.
- [NATIONAL CHARACTER VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character-varying.md): NATIONAL CHARACTER VARYING is a synonym for VARCHAR using the predefined utf8 character set.
- [NATIONAL CHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-character.md): NATIONAL CHARACTER is a synonym for the CHAR data type using the predefined utf8 character set.
- [NATIONAL VARCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varchar.md): NATIONAL VARCHAR is a synonym for the VARCHAR data type using the predefined utf8 character set.
- [NATIONAL VARCHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/national-varcharacter.md): NATIONAL VARCHARACTER is a synonym for VARCHAR using the predefined utf8 character set.
- [NCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar.md): NCHAR is a synonym for the fixed-length CHAR string data type using the utf8 character set.
- [NCHAR VARCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varchar.md): NCHAR VARCHAR is a synonym for the VARCHAR string data type using the utf8 character set.
- [NCHAR VARCHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varcharacter.md): NCHAR VARCHARACTER is a synonym for VARCHAR using the utf8 character set.
- [NCHAR VARYING](https://mariadb.com/docs/server/reference/data-types/string-data-types/nchar-varying.md): NCHAR VARYING is a synonym for the VARCHAR string data type using the utf8 character set.
- [RAW](https://mariadb.com/docs/server/reference/data-types/string-data-types/raw.md): In Oracle mode, RAW is a variable-length binary data type synonymous with VARBINARY.
- [ROW](https://mariadb.com/docs/server/reference/data-types/string-data-types/row.md): ROW is a data type used in stored programs to store a complete row of data from a cursor or table.
- [SET Data Type](https://mariadb.com/docs/server/reference/data-types/string-data-types/set-data-type.md): String object with zero or more values from a predefined list. A SET column can store multiple values selected from a list of permitted strings.
- [TEXT](https://mariadb.com/docs/server/reference/data-types/string-data-types/text.md): Complete TEXT type reference: TEXT(M) syntax, 65,535 byte maximum, 2-byte length prefix, DEFAULT value support, and indexing constraints rules.
- [TINYBLOB](https://mariadb.com/docs/server/reference/data-types/string-data-types/tinyblob.md): Very small binary object. A TINYBLOB column can store up to 255 bytes of binary data.
- [TINYTEXT](https://mariadb.com/docs/server/reference/data-types/string-data-types/tinytext.md): Very small character string. A TINYTEXT column can store up to 255 characters.
- [UUID Data Type](https://mariadb.com/docs/server/reference/data-types/string-data-types/uuid-data-type.md): Official UUID data type reference: 128-bit storage optimization, CAST from CHAR/VARCHAR/BINARY types, RFC4122 string format, and UUIDv6/v7 support.
- [VARBINARY](https://mariadb.com/docs/server/reference/data-types/string-data-types/varbinary.md): Variable-length binary string type. VARBINARY columns store binary strings of variable length up to a specified maximum.
- [VARCHAR](https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar.md): Complete VARCHAR reference: VARCHAR(M) syntax, length limits (0-65532 per row), CHARACTER SET/COLLATE options, indexing rules, and trailing spaces.
- [VARCHAR2](https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar2.md): Variable-length character string type. VARCHAR2 columns store strings of variable length up to a specified maximum (up to 65,535).
- [VARCHARACTER](https://mariadb.com/docs/server/reference/data-types/string-data-types/varcharacter.md): Variable-length character string type. VARCHARACTER columns store strings of variable length up to a specified maximum (up to 65,535).
- [XMLTYPE](https://mariadb.com/docs/server/reference/data-types/string-data-types/xmltype.md)
- [Character Sets and Collations](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets.md): Learn about character sets in MariaDB Server. This section details how different character sets and collations impact string storage, comparison, and sorting within your database.
- [Character Set and Collation Overview](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/character-set-and-collation-overview.md): Learn the core concepts of character sets and collations in MariaDB, including how they define string storage and sorting rules.
- [Setting Character Sets and Collations](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/setting-character-sets-and-collations.md): Complete Setting Character Sets and Collations data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range.
- [Supported Character Sets and Collations](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/supported-character-sets-and-collations.md): Complete character sets reference: SHOW CHARACTER SET command, information\_schema.CHARACTER\_SETS/COLLATIONS tables, NO PAD queries, and ci/cs flags.
- [Unicode](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/unicode.md): Explore MariaDB's support for Unicode, covering the differences between the utf8mb3 and utf8mb4 character sets for multi-byte storage.
- [Internationalization and Localization](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization.md): Discover how MariaDB supports internationalization and localization, enabling databases to store and process data in multiple languages.
- [Coordinated Universal Time](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/coordinated-universal-time.md): Coordinated Universal Time (UTC) is the primary time standard by which the world regulates clocks and time, and is the internal storage format for MariaDB timestamp values.
- [Locales Plugin](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/locales-plugin.md): The LOCALES plugin enables the INFORMATION\_SCHEMA.LOCALES table and SHOW LOCALES statement, allowing users to view all locales compiled into the server.
- [Server Locale](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/server-locale.md): Server locale settings control the language for date and time functions via lc\_time\_names and the language for error messages via lc\_messages.
- [Setting the Language for Error Messages](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/setting-the-language-for-error-messages.md): Learn how to configure the lc\_messages and lc\_messages\_dir system variables to display server error messages in a supported local language.
- [Time Zones](https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/time-zones.md): Complete Time Zones data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/data-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
