mysql建表时各列中数据类型的使用分析(代码实例)
create table userinfo( id int unsigned not null primary key auto_increment comment '主键', name varchar(20) default null comment '姓名', mobile char(11) default null unique comment '手机号码', address varchar(100) default null comment '居住地址', description text comment '个人简介', -- 当不确定长度时,可以使用text sex char(1) default null comment '性别', age tinyint default 0 comment '年龄', -- 年龄可以使用tinyint,范围为-128~127 idno char(18) default null comment '身份证号码', key telephone(mobile) -- 添加索引,提高查询效率 )