1. Insert record--insert intoinsert into table_name (field1,field2,field3) values (Value1,value2, VALUE3), or you can not specify a column name, but the order after values should be the same as the order in which the columns are arranged insert into table_name values (Value1,value2, VALUE3), or insert multiple records insert into table_name (FIELD1,FIELD2,FIELD3) values (VALUE1,VALUE2,VALUE3) at the same time ( VALUE1,VALUE2,VALUE3), (VALUE1,VALUE2,VALUE3); You can also insert values only on the specified columns, and default values for those that do not specify a column, or Nullinsert into if you do not specify a default value when you create the table. table_name (field1,field2) values (value1,value2); 2. Modify Records--updateupdate table_name set field1=value1,field2=value2 where . . .mysql> select * from zhuzhu; +------+--------+------+------+| id | myname | id1 | age |+------+--------+------+------+| null | zhang3 | null | null | | null | li4 | null | null |+------+--------+------+- -----+2 ROWS&Nbsp;in set (0.00 sec) mysql> update zhuzhu set id=1 where Myname= ' Zhang3 '; query ok, 1 row affected (0.05 sec) rows matched: 1 changed: 1 warnings: 0mysql> select * from zhuzhu;+------+--------+------+ ------+| id | myname | id1 | age |+------+---- ----+------+------+| 1 | zhang3 | null | null | | null | li4 | null | null |+------+--------+------+- -----+2 rows in set (0.01 SEC) 3. Deleting Records-delete fromdelete from table_name where ... #若没有where则是删除表中的所有的数据
This article from "Wave Scouring sand" blog, declined reprint!
MySQL's Action on Table records