为所有字段插入一条新的记录
insert [into] 表名 values (值1, 值2, ···);
或
insert into student(id, name, age, sex, email) value(1, '张三', 18, '男', 'zhangsan@163.com');
为指定字段插入一条新的记录
insert [into] 表名 (字段名1, 字段名2, ···) value(值1, 值2, ···);
为所有字段插入一条新的记录:使用set关键字
insert [into] 表名 set 字段名1=值1[, 字段名2 = 值2, ···];
为指定字段插入一条新的记录:使用set关键字
insert into student set name='刘美琪', age=19, email='liumeiqi@163.com';
为所有字段插入多条新的记录
insert [into] 表名[(字段名1, 字段名2, ···)] values
(值11, 值21, ···),
(值12, 值22, ···),
···;
为指定字段插入多条新的记录
insert [into] 表名(字段名1, 字段名2, ···) values
(值11, 值21, ···),
(值12, 值22, ···);
更新指定记录
update 表名 set 字段名1=值1[, 字段名2=值2, ···] where 条件;
更新全部记录
update 表名 set 字段名1=值1[, 字段名2=值2, ···]
删除指定记录
delete from 表名 where 条件;
删除全部记录
delete from 表名;
删除全部记录:TRUNCATE删除
truncate 表名;