通过Navicat导出数据字典

USE information_schema;

SELECT
    C.COLUMN_NAME AS '字段名',
    C.COLUMN_TYPE AS '数据类型',
    C.IS_NULLABLE AS '允许为空',
    C.EXTRA AS 'PK',
    C.COLUMN_COMMENT AS '字段说明'
FROM
    COLUMNS C
INNER JOIN TABLES T ON C.TABLE_SCHEMA = T.TABLE_SCHEMA
AND C.TABLE_NAME = T.TABLE_NAME
WHERE
    T.TABLE_SCHEMA = 'world' and T.TABLE_NAME='city'

——————————————————————————————
USE information_schema;

SELECT
    C.TABLE_NAME AS '表名' ,
    T.TABLE_COMMENT AS '表中文名' ,
    C.COLUMN_NAME AS '字段名' ,
    C.COLUMN_COMMENT AS '字段中文名' ,
    C.COLUMN_TYPE AS '数据类型' ,
    C.EXTRA AS '主键'
FROM
    COLUMNS C
INNER JOIN TABLES T ON C.TABLE_SCHEMA = T.TABLE_SCHEMA
AND C.TABLE_NAME = T.TABLE_NAME
WHERE
    T.TABLE_SCHEMA = 'world'
-- AND T.TABLE_NAME = 'city'
image.png
image.png
WORD文档

你可能感兴趣的:(通过Navicat导出数据字典)