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, 2586🔥, 0💬
Popular Posts:
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
How To Connect to a MySQL Server with a Port Number in MySQL? If you want to connect a MySQL server ...
How To Get the Definition of a Stored Procedure Back in SQL Server Transact-SQL? If you want get the...
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the T...