Syntax\n------\n\nSHOW CREATE TABLE tbl_name\n\nDescription\n-----------\n\nShows the CREATE TABLE statement that creates the given table. The statement requires the SELECT privilege for the table. This statement also works with views and SEQUENCE.\n\nSHOW CREATE TABLE quotes table and column names according to the value of the sql_quote_show_create server system variable.\n\nCertain SQL_MODE values can result in parts of the original CREATE statement not being included in the output. MariaDB-specific table options, column options, and index options are not included in the output of this statement if the NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and NO_KEY_OPTIONS SQL_MODE flags are used. All MariaDB-specific table attributes are also not shown when a non-MariaDB/MySQL emulation mode is used, which includes ANSI, DB2, POSTGRESQL, MSSQL, MAXDB or ORACLE.\n\nInvalid table options, column options and index options are normally commented out (note, that it is possible to create a table with invalid options, by altering a table of a different engine, where these options were valid). To have them uncommented, enable the IGNORE_BAD_TABLE_OPTIONS SQL_MODE. Remember that replaying a CREATE TABLE statement with uncommented invalid options will fail with an error, unless the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n\nNote that SHOW CREATE TABLE is not meant to provide metadata about a table. It provides information about how the table was declared, but the real table structure could differ a bit. For example, if an index has been declared as HASH, the CREATE TABLE statement returned by SHOW CREATE TABLE will declare that index as HASH; however, it is possible that the index is in fact a BTREE, because the storage engine does not support HASH.\n\nMariaDB permits TEXT and BLOB data types to be assigned a DEFAULT value. As a result, SHOW CREATE TABLE will append a DEFAULT NULL to nullable TEXT or BLOB fields if no specific default is provided.\n\nNumbers are quoted in the DEFAULT clause in SHOW CREATE statement.\n\nNumbers are not quoted in the DEFAULT clause in SHOW CREATE statement.\n\nIndex Order\n\nIndexes are sorted and displayed in the following order, which may differ from the order of the CREATE TABLE statement.\n\n PRIMARY KEY\n UNIQUE keys where all column are NOT NULL\n UNIQUE keys that don't contain partial segments\n Other UNIQUE keys\n LONG UNIQUE keys\n Normal keys\n Fulltext keys\n\nSee sql/sql_table.cc for details.\n\nExamples\n--------\n\nSHOW CREATE TABLE t\\G\n*********************** 1. row ************************\n       Table: t\nCreate Table: CREATE TABLE t (\n  id int(11) NOT NULL AUTO_INCREMENT,\n  s char(60) DEFAULT NULL,\n  PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-table