Home >Database >Mysql Tutorial >How do I view the CREATE TABLE statement for an existing MySQL table?
We can use SHOW CREATE TABLE query to view the table creation statements of existing tables.
SHOW CREATE TABLE table_name;
mysql> Show create table employee\G *************************** 1. row *************************** Table: employee Create Table: CREATE TABLE `employee` ( `Id` int(11) DEFAULT NULL, `Name` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec)
The above query gives the CREATE TABLE statement for the "Employee" table.
The above is the detailed content of How do I view the CREATE TABLE statement for an existing MySQL table?. For more information, please follow other related articles on the PHP Chinese website!