-- 查询数据库中有多少表
SELECT COUNT(1) TABLES, table_schema FROM information_schema.TABLES WHERE table_schema = '数据库名' GROUP BY table_schema;
-- 查询表中有多少字段
SELECT COUNT(*) FROM information_schema.COLUMNS WHERE table_schema = '数据库名' AND table_name = '表名';
-- 查询数据库中有多少字段
SELECT COUNT(column_name) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '数据库名';
-- 查询数据库中的所有表和所有字段、字段类型及注释等信息:
SELECT TABLE_NAME, column_name, DATA_TYPE, column_comment FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '数据库名' ;
标签:语句,information,--,SQL,Mysql,table,WHERE,SELECT,schema From: https://www.cnblogs.com/aerfazhe/p/17666898.html