Blogger Information
Blog 37
fans 1
comment 0
visits 27051
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1120_mysql基础1 九期第18课
叮叮当当
Original
727 people have browsed it

1. 数据库增删查改(手写)

  1. #增
  2. insert into `zsgc` (`user_name`,`desc`,`hobby`,`create_time`)
  3. values ('Jon','他是一名非常优秀的人','乒乓球', unix_timestamp(now()) );
  4. #删
  5. delete from `zsgc` where id= 5;
  6. #改
  7. update `zsgc` set `email`='123456@qq.com', `update_time`= unix_timestamp(now())
  8. where `user_name`='Jason';
  9. #查
  10. select * from `zsgc` where `id`> 2;

2. 创建数据表,每张表有10个字段(截图)

  1. show create table `zsgc`;
  2. CREATE TABLE `zsgc` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  4. `user_name` varchar(50) NOT NULL DEFAULT '' COMMENT '姓名',
  5. `psd` char(32) DEFAULT '' COMMENT '密码',
  6. `email` varchar(30) DEFAULT '' COMMENT '邮箱',
  7. `sex` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '性别 0为女 1为男',
  8. `desc` varchar(200) DEFAULT '' COMMENT '描述',
  9. `hobby` varchar(30) DEFAULT '' COMMENT '爱好',
  10. `create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
  11. `update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
  12. `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态 0为关闭 1为正常',
  13. PRIMARY KEY (`id`)
  14. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

Correcting teacher:查无此人查无此人

Correction status:qualified

Teacher's comments:完成的不错,继续加油
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post