SELECT
TABLE_NAME "表名",
COLUMN_NAME "字段名称",
COLUMN_TYPE "字段类型长度",
IF
( EXTRA = "auto_increment", CONCAT( COLUMN_KEY, "(", IF ( EXTRA = "auto_increment", "自增长", EXTRA ), ")" ), COLUMN_KEY ) "主外键",
IS_NULLABLE "空标识",
COLUMN_COMMENT "字段说明"
FROM
information_schema.COLUMNS
WHERE
TABLE_SCHEMA = 'gzh-test-sn';
SELECT
TABLE_NAME "表名",
TABLE_COMMENT "注释"
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'gzh-test-sn';
推荐阅读
- CTF题|BUUCTF-[极客大挑战 2019]EasySQL 1
- MySQL|MySQL高级-SQL优化步骤
- MySQL|MySQL 用户管理
- 国产数据库前50排名|介绍几个国产数据库
- mysql整数类型 存储范围与使用
- mysql|工作随笔(一)——docker和mysql容器搭建使用问题解决
- 错误|记录(There is no getter for property named ‘null‘ in ‘class)
- mybatis|java计算机毕业设计-数字相册管理系统-源码+数据库+系统+lw文档+mybatis+运行部署
- MySQL|MySQL中tinyint(1)与tinyint(2)的区别