Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.7 KB

sql-statement-show-create-table.md

File metadata and controls

47 lines (33 loc) · 1.7 KB
title summary aliases
SHOW CREATE TABLE | TiDB SQL Statement Reference
An overview of the usage of SHOW CREATE TABLE for the TiDB database.
/docs/v2.1/sql-statements/sql-statement-show-create-table/
/docs/v2.1/reference/sql/statements/show-create-table/

SHOW CREATE TABLE

This statement shows the exact statement to recreate an existing table using SQL.

Synopsis

ShowStmt:

ShowStmt

TableName:

TableName

Examples

mysql> CREATE TABLE t1 (a INT);
Query OK, 0 rows affected (0.12 sec)

mysql> SHOW CREATE TABLE t1;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                               |
+-------+------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL compatibility

This statement is understood to be fully compatible with MySQL. Any compatibility differences should be reported via an issue on GitHub.

See also