
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I see the CREATE TABLE statement of an 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.
- Related Questions & Answers
- How can we create a table from an existing MySQL table in the database?
- How can I drop an existing column from a MySQL table?
- Create MySQL query to create a table from an existing table?
- How can I change the name of an existing column from a MySQL table?
- Which statement, other than ALTER TABLE statement, can be used to apply UNIQUE constraint to the field of an existing MySQL table?
- How can we apply UNIQUE constraint to the field of an existing MySQL table?
- How can we have multiple virtuals GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
- How can we get a list of columns in an existing MySQL table?
- How to generate a “create table” command based on an existing table in MySQL?
- How can we get more details about columns of an existing table than return by MySQL SHOW COLUMNS statement?
- How can we delete an existing MySQL table by using PHP script?
- How can we create a new MySQL table by selecting specific column/s from another existing table?
- How can we apply the PRIMARY KEY constraint to the field of an existing MySQL table?
- How can I delete MySQL temporary table?
- How can we set PRIMARY KEY on multiple columns of an existing MySQL table?
Advertisements