1. 数据库增删查改(手写)
#增
insert into `zsgc` (`user_name`,`desc`,`hobby`,`create_time`)
values ('Jon','他是一名非常优秀的人','乒乓球', unix_timestamp(now()) );
#删
delete from `zsgc` where id= 5;
#改
update `zsgc` set `email`='123456@qq.com', `update_time`= unix_timestamp(now())
where `user_name`='Jason';
#查
select * from `zsgc` where `id`> 2;
2. 创建数据表,每张表有10个字段(截图)
show create table `zsgc`;
CREATE TABLE `zsgc` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_name` varchar(50) NOT NULL DEFAULT '' COMMENT '姓名',
`psd` char(32) DEFAULT '' COMMENT '密码',
`email` varchar(30) DEFAULT '' COMMENT '邮箱',
`sex` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '性别 0为女 1为男',
`desc` varchar(200) DEFAULT '' COMMENT '描述',
`hobby` varchar(30) DEFAULT '' COMMENT '爱好',
`create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
`update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态 0为关闭 1为正常',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8