Blogger Information
Blog 34
fans 0
comment 0
visits 21644
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
11月20日_mysql创建数据表,增删改查操作 - 九期线上班
只猫
Original
430 people have browsed it

一、创建数据表,十个字段

创建了一张用户表

二、数据库增删查改

新增数据

  1. INSERT INTO `user` (`username`,`password`,`tel`)VALUES('admin','admin','13698891621');

更新数据

  1. UPDATE `category` SET `alias`='日韩新片' WHERE `cate_id`=3;

删除数据

  1. DELETE FROM `movies` WHERE `mov_id`=3;

查找数据

  1. SELECT * FROM `movies` WHERE `mov_id`=9;

手写:

总结:

数据表创建时设计好字段属性包括:类型、长度、主键自增、非负(无符号)、是否为空、是否设置默认值。建立贴切的数据表属性是一个习惯。数据库在修改时一般不进行删除操作,可以定义一个删除属性,通过更改属性值来达到删除的目的。在进行更新数据的时候一定要设置条件,不然会更新所有的记录。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!