首页 > 数据库技术 > 详细

mysql5.7查看表结构命令show full columns from t_user

时间:2021-06-23 09:25:22      阅读:22      评论:0      收藏:0      [点我收藏+]

show full columns from t_user;   查看表全部结构。

Key = PRI     主键

Key = UNI     唯一索引

Key = MUL    普通索引

技术分享图片

 这张表的完整表结构长这样:

CREATE TABLE `t_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT primary key,
  `username` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT user name,
  `age` int(4) NOT NULL DEFAULT 20 COMMENT user age,
  `birthday_date_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT user birthday,
  `remark` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT remark something,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT create time,
  `version` int(4) NOT NULL DEFAULT 0 COMMENT update version,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_name`(`username`) USING BTREE,
  INDEX `idx_age_remark`(`age`, `remark`) USING BTREE,
  INDEX `idx_create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;

表结构截图:

技术分享图片

表索引结构:

 技术分享图片

end.

mysql5.7查看表结构命令show full columns from t_user

原文:https://www.cnblogs.com/zhuwenjoyce/p/14921058.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!