DML其实就是数据库操作语言,其实主要就是我们平时写的增删改语句。
添加
insert into 表名(字段1,字段2..)values('值1','值2');
修改
update 表 set 字段=值,字段=值.. where 字段=值;
--在某个范围内
update 表 set 字段=值,字段=值.. where 字段 between 值 and 值;
AND(&&)
update 表 set 字段=值,字段=值.. where 字段=值 and 字段=值;
OR(||)
update 表 set 字段=值,字段=值.. where 字段=值 or 字段=值;
删除
delete from 表名 where 字段=值;
删除表中的所有数据
delete from students; --不会影响自增
truncate table students; --自增会归零
InnoDB:自增会从1开始
MyISAM:继续从上一个自增量开始