mysql代码建立数据库_31-mysql 代码建立数据库

drop database if exists tt;

create database tt default character set utf8;

use tt;

create table admin_tb(

id int(11) auto_increment primary key,

username varchar(20) not null unique,

password varchar(20) not null,

name varchar(10) not null,

createtime timestamp default current_timestamp

)engine=InnoDB auto_increment=1 default charset=utf8;

INSERT INTO admin_tb (username,password,name) VALUES ('xx','xx','xx');

create table user_tb(

id int(11) auto_increment primary key,

username varchar(20) not null unique,

password varchar(20) not null,

name varchar(20) not null,

nicknamek varchar(20),

sex varchar(1) check(sex='男' or sex='女'),

birth date,

phone varchar(15),

qq varchar(11),

integral int(5) default 5,

signature varchar(200),

avater varchar(200), /*头像*/

status int(2) default 1,

createtime timestamp default current_timestamp

)engine=InnoDB auto_increment=1 default charset=utf8;

INSERT INTO user_tb (username,password,name,nicknamek,sex,birth,phone,qq,integral,signature)

VALUES ('xx','xx','xx','xx','m','1996-7-27','33','33','5','from xx');

INSERT INTO user_tb (username,password,name,nicknamek,sex,birth,phone,qq,integral,signature)

VALUES ('xx','xx','xx','xx','m','1996-7-27','333','33','5','from xx');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值