#查詢某個庫所有表
select * from information_schema.TABLES
where table_schema = '數據庫'
#查詢某個庫所有表的字段
select * from information_schema.COLUMNS
where table_schema = '數據庫'
#查詢所有表的注釋和字段注釋
SELECT
a.table_name 表名,
a.table_comment 表說明,
b.COLUMN_NAME 字段名,
b.column_comment 字段說明,
b.column_type 字段類型,
b.column_key 約束
FROM
information_schema. TABLES a
LEFT JOIN information_schema. COLUMNS b ON a.table_name = b.TABLE_NAME
WHERE
a.table_schema = '數據庫'
ORDER BY
a.table_name
