1. 查询当前所在数据库所有表信息
select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables where table_schema = (select database()) order by create_time desc
select database(),当前数据库名称:
2.获取单个建表语句:
SHOW CREATE TABLE '表名'
3. 查询表中所有字段的属性(字段类型,名称,长度,描述,是否可空)(table_name=‘表名’)
select column_name, is_nullable, data_type, column_comment, column_key, extra from information_schema.columns
where table_name = 'test' and table_schema = (select database()) order by ordinal_position