View CREATE TABLE Statement of Existing MySQL Table



We can see the create table statement of an existing table by using SHOW CREATE TABLE query.

Syntax

SHOW CREATE TABLE table_name;

Example

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 query above gives the CREATE TABLE statement of ‘Employee’ table.

Updated on: 2020-06-19T13:53:51+05:30

811 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements