All Products
Search
Document Center

Data Management:Query and modify table schemas

Last Updated:Mar 30, 2026

Use the SQL Console in DMS to view or modify a table's schema — either by running an SQL statement or through the graphical user interface (GUI).

Prerequisites

Before you begin, ensure that you have:

  • Permissions to query, modify, and export data in the target database. For more information, see Manage RAM permissions.

Query a schema

DMS provides two ways to view a table's schema: run an auto-generated SQL statement, or inspect the table's object information directly.

Run an SQL statement

  1. Go to the SQL Console tab.

  2. On the SQL Console tab, double-click the table name. DMS auto-generates an SQL statement to query the table's schema. Click Execute.

View object information

  1. Go to the SQL Console tab.

  2. In the navigation tree on the left, right-click the target table and select Object Information.

    image.png

  3. In the Create Statement section, view the statement used to create the table.

    image.png

Change a schema

DMS supports two approaches for schema changes: SQL statements for precise control, and the GUI for visual editing of columns, indexes, foreign keys, and the storage engine.

Warning

Schema changes can affect relevant databases and business. Proceed with caution when you change a schema.

Run an SQL statement

  1. Go to the SQL Console tab.

  2. Enter an ALTER TABLE statement and click Execute. The following example adds a phone_number column to test_table:

    ALTER TABLE `test_table`
      ADD COLUMN `phone_number` varchar(32) NOT NULL COMMENT 'phone_number' AFTER `age`;

Use the GUI

The GUI lets you add columns and set column properties without writing SQL. You can also add foreign key indexes and modify the storage engine. The following example adds a column to test_table.

  1. Go to the SQL Console tab.

  2. In the navigation tree on the left, right-click the target table and select Edit Table Structure.

  3. In the navigation pane on the left, click Column Information.

  4. On the Column Information tab, click New. A new row appears.

  5. Enter the column details in the new row, then click Modify at the bottom of the tab.

  6. In the Modify dialog box, click Execute.

    image.png

What's next

To apply multiple schema changes in a single operation, see Data change.