MySQL运维SQL
SELECT COUNT(*) AS table_count FROM information_schema.TABLES WHERE table_schema = '数据库名';
SELECT
COUNT(*) AS field_count
FROM
information_schema.COLUMNS
WHERE
table_schema = '数据库名'
AND table_name = '表名';
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = '数据库名'
AND TABLE_NAME = '表名'
AND IS_NULLABLE = 'NO';