建表的sql

1、 创建用户表

create table user(
    id int unsigned not null primary key auto_increment comment '自增id',
    username char(20) not null default '' comment '用户名',
    password char(32) not null default '' comment '密码',
    income decimal (10,2) not null default 0.00 comment '收入',
    logintime int(10) unsigned not null comment '上次登录时间',
    loginip varchar(30) not null comment '上次登录ip',
    isOpen tinyint(1) unsigned not null default 0 comment '是否开放',
    birthday TIMESTAMP not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
) engine myisam default charset utf8 comment '用户表';

note : 
    1. decimal (10,2) 整数8位,小数2位

posted @ 2016-11-18 23:29  Thomas_188  阅读(140)  评论(0编辑  收藏  举报