OceanBase logo

OceanBase

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

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

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

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 Cloud

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    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 Cloud
    iconOceanBase Cloud

      SQL editing and execution

      Last Updated:2026-04-07 08:08:34  Updated
      share
      What is on this page
      Prerequisites
      Edit SQL statements
      Execute SQL statements
      View data
      More information

      folded

      share

      The SQL window is the user interface for handling data. This topic aims to explain how to edit and execute SQL statements in the SQL window. Using the creation of a table as an example, this topic demonstrates how to create a table named 'employee' in the 'odc_test' database within the SQL window.

      Note

      The data used in this topic are examples. You can replace them with actual data as needed.

      Prerequisites

      You need to have the database account and password for the current tenant to log in to the SQL Console.

      Edit SQL statements

      1. Log in to the SQL Console and open the SQL window.

      2. In the SQL window, edit the SQL statement to create the 'employee' table in the 'odc_test' database.

        1

        CREATE TABLE employee (emp_no int(120) COMMENT 'employee number' NOT NULL, birthday date COMMENT 'employee birthday' NULL, name varchar(120) COMMENT 'employee name' NULL, CONSTRAINT cons_employee_empno PRIMARY KEY (emp_no)) DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
        

        Syntax Format:

        CREATE TABLE table_name (column_name column_type, column_name column_type,.......);
        
        Parameter Description
        CREATE TABLE Used to create a table with the given name, must have CREATE table permissions.
        table_name The name of the table to be created, which must conform to identifier naming rules.
        column_name column_type Specifies the name and data type of each column (field) in the data table, separated by commas if creating multiple columns.
        • As shown in the image above, click in the SQL window to switch databases.

        • For details on the SQL window toolbar, refer to Functional keys in SQL Console.

      Execute SQL statements

      After completing the SQL statement editing, click in the toolbar of the SQL window to execute all SQL statements in the current SQL window.

      4

      View data

      1. In the left navigation bar of the SQL window, confirm whether the table employee has been created in the database odc_test.

        5

      2. Right-click on the table employee and select View Table Data, or edit a SELECT statement in the SQL window.

        6

      More information

      • SQL Console overview

      • PL compilation

      • Result set editing

      • Execution analysis

      • Session variable management

      • Functional keys in SQL Console

      Previous topic

      Access SQL Console
      Last

      Next topic

      PL compilation
      Next
      What is on this page
      Prerequisites
      Edit SQL statements
      Execute SQL statements
      View data
      More information