Home >Database >Mysql Tutorial >How to get information about a specific column in a table through the MySQL DESCRIBE statement?
As we all know, DESCRIBE statement will provide the information/structure of the entire table. With the help of DESCRIBE statement along with table name and column name we can get information about the column.
DESCRIBE table_name col_name;
mysql> Describe employee ID; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | +-------+---------+------+-----+---------+----------------+ 1 row in set (0.11 sec)
The above query will provide " ID" column information.
mysql> Describe employee name; +-------+-------------+------+-----+---------+---------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+---------+ | Name | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+---------+ 1 row in set (0.03 sec)
The above query will provide information about another column "Name" of the table named "employee".
The above is the detailed content of How to get information about a specific column in a table through the MySQL DESCRIBE statement?. For more information, please follow other related articles on the PHP Chinese website!