In this article we will see "How to DESCRIBE a Table in MySql" to display struture of a table and "MySql DESCRIBE TABLE query syntax with example".

"DESCRIBE TABLE" query syntax

"DESCRIBE TABLE" is used to DESCRIBE a Table in MySql, the syntax is as follow.


DESCRIBE tableName;

"DESCRIBE TABLE" query example

"DESCRIBE TABLE" is used to DESCRIBE a Table in MySql, as shown in the example below.


/* Use database where the table is going to be DESCRIBEd*/
use testDatabase;

/* DESCRIBE table */
DESCRIBE testTable;

Output: Output will be something like this:


+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id    | int(11)     | YES  |     | NULL    |       |
| email | varchar(50) | YES  |     | NULL    |       |
| name  | varchar(20) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.01 sec)


In this article we have seen "How to DESCRIBE a Table in MySql" to display structure of a table, in upcoming articles we will see more about Mysql syntax and queries with example.
  • By Techburps.com
  • Oct 17, 2017
  • MySql