使用Navicat快速生成MySQL数据字典
1、通过information_schema.COLUMNS表
查询该表可得到所需字段信息
SELECT * FROM information_schema.COLUMNS;
如下图所示:
2、示例
下面截图是示例:
SQL语句如下
SELECT t.TABLE_SCHEMA AS 库名, t.TABLE_NAME AS 表名, t.COLUMN_NAME AS 字段名, t.COLUMN_TYPE AS 数据类型, CASE IFNULL(t.COLUMN_DEFAULT,'Null') WHEN '' THEN '空字符串' WHEN 'Null' THEN 'NULL' ELSE t.COLUMN_DEFAULT END AS 默认值, CASE t.IS_NULLABLE WHEN 'YES' THEN '是' ELSE '否' END AS 是否允许为空, t.COLUMN_COMMENT AS 字段说明 FROM information_schema.COLUMNS t WHERE t.TABLE_SCHEMA='feifei' AND t.TABLE_NAME='order_info';
3、导出Excel
点击导出结果即可导出
相关推荐
zhanbuquan 2020-08-15
KaiZhaoKZ 2020-05-25
ericxieforever 2020-05-07
langyue 2020-05-03
zjyhll 2020-04-26
whyname 2020-03-07
wangshuangbao 2020-02-16
云之飞踢 2020-02-03
Streamoutput 2019-12-31
zxznsjdsj 2019-12-11
数据库之扑朔迷离 2019-11-04
LuoXinLoves 2019-10-23
zhbvictor 2012-08-29
电脑商情报 2015-03-03
wujun 2012-03-19
中草药代码 2010-07-07