As we know the EXPLAIN statement will provide the information/structure of the whole table. With the help of the EXPLAIN statement along with the table name and the column name, we can get the information about that column.
EXPLAIN table_name col_name;
mysql> EXPLAIN employee ID; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | +-------+---------+------+-----+---------+----------------+ 1 row in set (0.11 sec)
The query above will give the information about the column ‘ID’ of a table named ‘employee’.
mysql> EXPLAIN employee name; +-------+-------------+------+-----+---------+---------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+---------+ | Name | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+---------+ 1 row in set (0.03 sec)
The query above will give the information about the other column ‘Name’ of a table named ‘employee’.