show ddl

show ddl <table>

The show ddl query retrieves the DDL statement for a specified table. If the table has indexes, the statement returns the DDLs for the table and the indexes.

Example : Fetch the DDL for a specified table.

The following statement fetches the DDL for the BaggageInfo table.
show ddl BaggageInfo;
Output:
CREATE TABLE IF NOT EXISTS BaggageInfo (ticketNo LONG, fullName STRING, gender STRING,
      contactPhone STRING, confNo STRING, bagInfo JSON, PRIMARY
    KEY(SHARD(ticketNo)))
In the following example, the fixedschema_contact index exists in the BaggageInfo table. The statement retrieves the DDLs for the BaggageInfo table and fixedschema_contact index on the table.
show ddl BaggageInfo;
Output:
CREATE TABLE IF NOT EXISTS BaggageInfo (ticketNo LONG, fullName STRING, gender STRING,
        contactPhone STRING, confNo STRING, bagInfo JSON, PRIMARY
      KEY(SHARD(ticketNo)))CREATE INDEX IF NOT EXISTS fixedschema_contact ON
    BaggageInfo(contactPhone)