1

Rather than getting table structure (DESC tablename;) Is there any possibility to get table syntax (query) in mysql ?

2 Answers 2

1

I assume you are asking for this:

SHOW CREATE TABLE table_name

This will show you an SQL statement that could be used to create the table schema.

Sign up to request clarification or add additional context in comments.

Comments

1

Try this

SHOW CREATE TABLE tablename

You may check out SHOW CREATE TABLE Syntax

Shows the CREATE TABLE statement that creates the named table. To use this statement, you must have some privilege for the table. As of MySQL 5.0.1, this statement also works with views.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.