Chinaunix首页 | 论坛 | 博客
  • 博客访问: 449361
  • 博文数量: 80
  • 博客积分: 2301
  • 博客等级: 大尉
  • 技术积分: 884
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-16 20:07
个人简介

I\'m interested in mathematics and Daoism. Welcome to talk about these subjects with me.

文章分类

全部博文(80)

文章存档

2017年(2)

2016年(16)

2015年(4)

2014年(6)

2013年(22)

2012年(2)

2011年(1)

2010年(4)

2009年(20)

2008年(2)

2007年(1)

我的朋友

分类: Mysql/postgreSQL

2016-03-18 11:18:31

    创建一个表的时候,如果字段过多,使用英语又不方便,可以使用汉语拼音,然后在字段边上加注释。就像这样:

     create table test_table (name varchar(60) comment "测试",  age int);

    然后使用使用命令"show create table test_table"就可以查看到建表的语句,从而知道每一个字段是什么意思。输出如下:

+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Table      | Create Table                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| test_table | CREATE TABLE `test_table` (
  `name` varchar(60) DEFAULT NULL COMMENT '测试',
  `age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+


阅读(732) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~