摘要: 主键索引: 确定唯一的一条记录,只能有一个主键(primary key) 主键不能为空 1、create table if not exists t1(id int not null auto_increment primary key, name varchar(10) not null default ''); 2、create table if not exists t1(id int not null auto_increment, name varchar(10) not null default '', primary key(id));唯一索引:( 阅读全文
posted @ 2013-09-29 15:26 激扬飞雪 阅读(165) 评论(0) 推荐(0)
摘要: 字段属性:unsigned: 无符号类型,只能修饰数值类型;create table if not exists t1(id int unsigned);zerofill:前端填0 //只能修饰数值类型create table if not exists t1(id int(4) zerofill, price float(10,3) zerofill, name varchar(10));auto_increment: 自动增长create table if not exists t1(id int auto_increment primary key, name varchar(10)); 阅读全文
posted @ 2013-09-29 13:50 激扬飞雪 阅读(177) 评论(0) 推荐(0)
摘要: mysql数据类型:数值型: 整形:int 浮点型:float double decimal:定点型日期: date '2012-01-02' time '10:01:01' datetime '2012-03-04 03:03:04' datestamp :时间戳 year '2012'字符型: char(); ---------------------255 varchar(); -----------------255 text blob enum('1', '2', '4') 阅读全文
posted @ 2013-09-29 10:55 激扬飞雪 阅读(167) 评论(0) 推荐(0)