This topic describes how to query all mapping tables, query the information about a mapping table, and query the data in a table by executing SQL statements in SQL mode.

Enter the SQL mode

Run the sql command to enter the SQL mode.

Query mapping tables

Query the mapping tables of a table in an instance.

Run the SHOW TABLES; command to query the mapping tables of a table in an instance.

The following result is returned:
+----------------------+
| Tables_in_myinstance |
+----------------------+
| mytable              |
+----------------------+
| mytstable            |
+----------------------+
| mytstable::meta      |
+----------------------+

In the preceding command output, mytable is the data table for which mapping tables are created, mytstable is a time series data table, and mytstable::meta is a time series metadata table.

Query information about a mapping table

Query information about a mapping table.

  • Command syntax
    DESCRIBE table_name;
  • Examples

    The following sample code shows how to query the information about the mapping table named mytable:

    DESCRIBE mytable;
    The following result is returned:
    +-------+---------------+------+-----+-------+
    | Field | Type          | Null | Key | Extra |
    +-------+---------------+------+-----+-------+
    | uid   | varchar(1024) | NO   | PRI |       |
    +-------+---------------+------+-----+-------+
    | pid   | bigint(20)    | NO   | PRI |       |
    +-------+---------------+------+-----+-------+
    | b     | double        | YES  |     |       |
    +-------+---------------+------+-----+-------+
    | c     | tinyint(1)    | YES  |     |       |
    +-------+---------------+------+-----+-------+
    | d     | mediumtext    | YES  |     |       |
    +-------+---------------+------+-----+-------+

Query the data in a table

Query the data in a table by executing the SELECT statement.

Run the following command to query all time series data in a time series table named mytstable:
SELECT * FROM mytstable limit 10;

Exit the SQL mode

Run the exit; command to exit the SQL mode.