mysqlCRUD


一、介绍

CRUD即增加(Create)、查询(Retrieve)、更新(Update)、删除(Delete)四个单词的首字母缩写。

In computing, CRUD is an acronym for create, Retrieve, update, and delete. It is used to refer to the basic functions of a database or persistence layer in a software system.

C reate new records

R etrieve existing records

U pdate existing records

D elete existing records.

平常我们说的系统开发中的增改查删可以用CURD来表示 增加:Create 修改:Update查找:Read删除:Delete 外国人喜欢CRUD,表示增查改删: 增加:Create读取查询:Retrieve更新:Update删除:Delete

二、insert和repleace 

repleace 与insert基本上一样

不一样的是:insert 如果指定主键,唯一约束存在,则报错,replace则修改

insert into stu value(null,'李四',22,'女','郑州');

insert stu(name,address) values('李平','北京'),('刘阳','上海'),('赵强','广州');

replace into stu values(null,'王五',25,'女','河南省郑州市');

 insert 15:12:38