Skip to content

Commit

Permalink
ebnf show create table (pingcap#17089)
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed May 15, 2024
1 parent 96addc1 commit c365b70
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions sql-statements/sql-statement-show-create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,23 @@ This statement shows the exact statement to recreate an existing table using SQL

## Synopsis

**ShowCreateTableStmt:**

![ShowCreateTableStmt](/media/sqlgram/ShowCreateTableStmt.png)

**TableName:**

![TableName](/media/sqlgram/TableName.png)
```ebnf+diagram
ShowCreateTableStmt ::=
"SHOW" "CREATE" "TABLE" (SchemaName ".")? TableName
```

## Examples

```sql
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` (
mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)
```

Expand Down

0 comments on commit c365b70

Please sign in to comment.