您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MySQL 的 DESCRIBE 命令?

2024/2/26 0:44:07发布25次查看
mysql的describe或desc都是等效的。 desc 是 describe 命令的缩写形式,用于显示表的信息,如列名和列名约束。
describe 命令相当于以下命令 -
show columns from yourtablename command.
以下是借助 describe 命令显示有关表的信息的查询。查询如下。
mysql> describe student;
上面,student 是我数据库中的表名。
上述查询生成以下输出。
+-------+--------------+------+-----+---------+-------+| field | type | null | key | default | extra |+-------+--------------+------+-----+---------+-------+| id | int(11) | yes | mul | null | || name | varchar(100) | yes | mul | null | |+-------+--------------+------+-----+---------+-------+2 rows in set (0.13 sec)
这是给出相同结果的等效查询。查询如下。
mysql> show columns from student;
以下是输出。
+-------+--------------+------+-----+---------+-------+| field | type | null | key | default | extra |+-------+--------------+------+-----+---------+-------+| id | int(11) | yes | mul | null | || name | varchar(100) | yes | mul | null | |+-------+--------------+------+-----+---------+-------+2 rows in set (0.03 sec)
正如您在上面看到的,它们都给出相同的输出。
以上就是mysql 的 describe 命令?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product