MysqL desc命令用于查看表结构,是DESCRIBE命令的简写形式。
MysqL desc命令语法:
实例: MysqL>
MysqL> desc employee;
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| ID | int(2) | NO | PRI | NULL | auto_increment |
| First_name | varchar(20) | YES | | NULL | |
| Last_name | varchar(30) | YES | | NULL | |
| Start_date | date | YES | | NULL | |
| Salary | int(6) | YES | | NULL | |
| city | varchar(20) | YES | | NULL | |
| description | varchar(20) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)