mysql中所有表的说明
select * from INFORMATION_SCHEMA.TABLES
查看单个库中的表的说明
# 方式一:
show table status from 数据库名;
# 方式二:
select * from information_schema.Tables where table_schema = '数据库名';
查看单个库中所有表,部分说明
-- 查看表名与表的备注(table_name, table_comment)
select table_name, table_comment from information_schema.Tables 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
查看库中某个表说明
show full columns from db_name.table_name;
查看库中某个表部分说明
select
COLUMN_NAME 字段名, column_comment 字段说明, column_type 字段类型, column_key 约束
from information_schema.columns
where table_schema = '数据库名' and table_name = '表名' ;