SQL Console Queries

Updated at:
Copy as MD

The SQL window lets you conveniently execute various SQL statements. It also supports visual operations on the target database, such as creating, deleting, modifying, and querying data. This makes it ideal for data querying and data development.

Prerequisites

You must have query permissions on the target database or table. To apply for permissions, see Apply for asset permissions by submitting a ticket.

SQL window interface

The SQL window consists of four main sections: the Visual Operation Area (①), the Extended Features Area (②), the Command Execution Area (③), and the Execution Results Area (④). The following table describes these sections.

Table 1. SQL window interface overview

#

Area

Description

①

Visual Operation Area

Manage your database visually.

  • Table

    You can view all tables in the current database, including their columns, column types, and indexes. You can also right-click a table to edit its structure, manage it, export or import data, and perform batch operations.

  • Programmable Object

    Create, view, execute, and manage Programmable Objects, such as views, stored procedures, functions, triggers, and events.

    Note

    The console displays up to 1,000 entries.

  • key-value pair information

    Note

    DMS displays this information for NoSQL databases.

②

Extended Features Area

The following features are available:

  • Switch between instances and databases.

  • Switch the logged-in database account.

  • Table Details (Table List): Click this icon to switch to the Table List page, and click the Query icon to return to the Query page.

③

Command Execution Area

Enter an SQL statement and click Execute to perform operations on the database. Other features are also available, such as Format, execution plan, and Settings.

  • Execute: Click Execute to run the SQL statement you entered.

  • Format: Click Format to optimize the format of your SQL statement.

    For example, if you enter SELECT * FROM `test_table`; and click Format, the SQL statement is formatted as follows:

    SELECT
      *
    FROM
      `test_table`;
  • Execution plan: View the execution plan for the SQL statement you entered.

Note

You can click the 增加页签 icon in the upper-right corner of the page to open multiple SQL Console windows.

④

Execution Results Area

After you execute an SQL statement, the results appear here.

Note

Click Execution History to view the SQL execution history, which includes details such as the start time, database, and SQL, and can be exported.

Procedure

  1. Log on to the Yaochi console - Data + AI studio.

  2. In the Select Database dialog box, search for and select a database, and then click Confirm.

  3. In the Log on to Instance dialog box, enter the database account and database password.

  4. In the SQL Console area, enter an SQL statement, and then click Execute.

Related documents