OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V2.2.77Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V2.2.77
    iconOceanBase Database
    SQL - V 2.2.77Enterprise Edition
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    About SQL data types

    Last Updated:2023-08-18 09:26:34  Updated
    Share
    What is on this page
    Share

    When you create a table, you must specify a data type for each column in the table. A data type defines the type of data that can be stored in a column. For example, a DATE column can store values like "2020-02-20" but cannot store numbers such as 2 or strings such as "hello".

    For more information about SQL data types, see SQL Reference (MySQL mode). The following table describes some common data types.

    Category
    Type
    Remarks
    Numeric data types - integer BIGINT Signed range: [-2^63, 2^63 - 1] Unsigned range: [0, 2^64 - 1]
    Numeric data types - integer INT INTEGER Signed range: [-2^31, 2^31-1] Unsigned range: [0, 2^32-1]
    Numeric data types - integer SMALLINT Signed range: [-2^15, 2^15-1] Unsigned range: [0, 2^16-1]
    Numeric data types - integer BOOL BOOLEAN TINYINT Signed range: [-2^7, 2^7-1] Unsigned range: [0, 2^8-1]
    Numeric data types - fixed-point DECIMAL(p,s) DECIMAL is equivalent to NUMERIC.
    Numeric data types - floating-point FLOAT Signed range: [-2^128, 2^128] Unsigned range: [-2^1024, 2^1024] 7 digits of precision
    Numeric data types - floating-point DOUBLE Signed range: [-2^1024, 2^1024] Unsigned range: [0, 2^1024] 15 digits of precision
    Numeric data types - integer/fixed-point/floating-point number number(p) number(p, s) p stands for precision and s stands for scale, the number of digits after the decimal point. The maximum precision is 38 and the scale can range from -84 to 127. * A value with both precision and scale is a fixed-point value. * A value with a scale of 0 is an integer value. * A value without precision and scale is a floating-point value with a maximum precision of 38.
    Character data types - variable-length VARCHAR(N) Maximum length: 256 KB. Character set: UTF8MB4.
    Character data types - variable-length VARBINARY Maximum length: 256 KB. Character set: BINARY.
    Character data types - variable-length enum Maximum number of elements: 65,535. Maximum length of each element: 255 characters. Character set: UTF8MB4.
    Character data types - variable-length set Maximum number of elements: 64. Maximum length of each element: 255 characters. Character set: UTF8MB4.
    Character data types - fixed-length CHAR(N) Maximum length: 256 KB. Character set: UTF8MB4.
    Character data types - fixed-length binary Maximum length: 256 KB. Character set: BINARY.
    Date and time data types DATE The DATE type is used for values that contain only a date. The DATE values are retrieved and displayed in YYYY-MM-DD format.
    Date and time data types TIME The TIME type is used for values that contain only a time. The TIME values are retrieved and displayed in HH:MM:SS[.fraction] format.
    Date and time data types DATETIME The DATETIME type is used for values that contain both a date and a time (exclusive of the time zone). The DATETIME values are retrieved in YYYY-MM-DD HH:MM:SS[.fraction] format.
    Date and time data types TIMESTAMP The TIMESTAMP data type is used for values that contain both date and time.
    Date and time data types YEAR Format: YYYY. Range: [1901,2155]
    Large-object data types TEXT/BLOB Maximum length: 64 KB
    Large-object data types LONGTEXT/LONGBLOB Maximum length: 48 MB

    Previous topic

    About DDL statements
    Last

    Next topic

    Create a table
    Next