发表于: 2016-04-06 01:52:50

1 2148


今天完成的事情:

    使用MySQL命令行建表,增删改查。

明天计划的事情:

    完成JDK和Maven环境搭建。

    争取完成编写Junit,使用Mybatis读写数据库。

遇到的问题:

    首次使用命令行操作数据库,遇到问题几乎都是百度。

收获:

MySQL数据库常用字段

连接MySQL方法:



创建数据库表大致分析:

1. 页面上注册信息: 手机号,密码

2. 要求:ID 自增, 创建时间, 更新时间

分析:1) 新建用户时,需要查询数据库是否有重复手机号,所以该字段建立索引可以加快查表速度。

          2) 密码字段该加密存储(只能在代码中体现)

          3) 创建时间和更新时间使用1970年至今毫秒数查询速度会快,便于代码处理(百度得知)

**创建表语句

create table t_userinfo
(
id bigint not null auto_increment primary key,
phone bigint not null,
password varchar(25) not null,
creat_at bigint not null,
update_at bigint not null,
index phone(phone)
);

insert into t_userinfo values ('1','15101145655','232212','234324234','34234234232');
select * from t_userinfo;
delete from t_userinfo where id ='1';
drop table t_userinfo;


已工作常加班,希望能坚持每晚两小时学习下技能。



返回列表 返回列表
评论

    分享到