Collections:
Show CREATE TABLE Statements of Existing Tables in MySQL
How To See the CREATE TABLE Statement of an Existing Table in MySQL?
✍: FYIcenter.com
If you want to know how an existing table was created, you can use the "SHOW CREATE TABLE" command to get a copy of the "CREATE TABLE" statement back on an existing table. The following tutorial script shows you a good example:
mysql> SHOW CREATE TABLE tip; +-------+------------------------------- | Table | Create Table +-------+------------------------------- | tip | CREATE TABLE `tip` ( `id` int(11) NOT NULL, `subject` varchar(80) NOT NULL, `description` varchar(256) NOT NULL, `create_date` date default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +-------+------------------------------- 1 row in set (0.38 sec)
Comparing with the original "CREATE TABLE" statement used in the previous tutorial, the output tells you that:
⇒ Creating New Tables with SELECT Statements in MySQL
⇐ Show All Columns of an Existing Table in MySQL
2018-03-04, 2826🔥, 0💬
Popular Posts:
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How To Convert Numeric Expression Data Types using the CAST() Function in SQL Server Transact-SQL? I...
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...