# 常用 SQL 语句

# 1. 获取所有表的表名

MySQL:

select
    table_name
from
    information_schema.tables
where
    table_schema='${databaseName}'

# 2. 获取表字段的信息

MySQL:

select
    column_name,
    is_nullable,
    column_key,
    data_type,
    column_comment
from
    information_schema.columns t
where
    table_schema='${databaseName}' and table_name='${tableName}'
本章目录