mysql查看表结构源码语法代码教程
mysql查看表结构源码语法代码教程语法:
desc 表名-- 方法一
mysql> describe stu2;
+-------+-------------+------+-----+----------+----------------+
| Field | Type | Null | Key | Default| Extra |
+-------+-------------+------+-----+----------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name| varchar(20) | NO | | NULL | |
| add | varchar(50) | NO | | 地址不详 | |
| score | int(11) | YES| | NULL | |
+-------+-------------+------+-----+----------+----------------+
4 rows in set (0.05 sec)
-- 方法二
mysql> desc stu2;
+-------+-------------+------+-----+----------+----------------+
| Field | Type | Null | Key | Default| Extra |
+-------+-------------+------+-----+----------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name| varchar(20) | NO | | NULL | |
| add | varchar(50) | NO | | 地址不详 | |
| score | int(11) | YES| | NULL | |
+-------+-------------+------+-----+----------+----------------+
4 rows in set (0.00 sec)
页:
[1]