Home » Mysql » Difference between DESCRIBE and EXPLAIN MYSQL statements

Difference between DESCRIBE and EXPLAIN MYSQL statements

Difference between DESCRIBE and EXPLAIN MYSQL statements

Describe : Describe used to obtain information about table structure.

Explain : Command used to understanding and optimizing MySQL queries and will be processed to detect potential performance issues, MySQL displays information from the optimizer about the statement execution plan. Explain command will be used to insert update and other MySQL quires.

Explian Extended : provides additional information and estimates the number of table rows that are filtered.

To explain the DESCRIBE, EXPLAIN, and EXTENDED EXPLAIN we have create a demo database named "demodata". and also create two table department and students.

MYSQL query to Create the Department Table

Insert dummy data in Departmant Table

MYSQL query to create the Student Table

Insert Test data in Student Table

Now We Run DESCRIBE MYSQL Command

Now We Run EXPLAIN MYSQL Command

Now We Run EXPLAIN EXTENDED MYSQL Command

, , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">