zoukankan      html  css  js  c++  java
  • 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');
    

      

  • 相关阅读:
    TP5多条件搜索,同时有必要条件
    微信支付模式二 统一下单一直提示签名错误
    Js选择器总结
    video.js视频播放插件
    chosen 下拉框
    在MySQL中实现Rank高级排名函数
    解决html页面英文和数字不自动换行,但中文就可以自动换行
    php去除html标签
    day29 继承
    day28 作业
  • 原文地址:https://www.cnblogs.com/zhumengdexiaobai/p/10263287.html
Copyright © 2011-2022 走看看