- DML英文全称是Data Manipulation Language(数据操作语言),用来对数据库中表的数据记录进行增删改等操作
DML-添加数据
insert into employee(id, workno, name, gender, age, idcard) values (1,'1','Itcast','男',10,'123456789012345678');select * from employee;insert into employee values (2,'2','喜洋洋','男',18,'123456781212345678');insert into employee values (3,'3','熊大','男',38,'123453489012345678'),(4,'4','光头强','男',44,'123456219012345678');
DML-修改数据
-- 修改id为1的数据, 将name修改为itheim
update employee set name = 'itheim' where id = 1;-- 修改id为1的数据, 将name修改为小红 , gender 修改为女
update employee set name = '小红' , gender = '女' where id = 1;
DML-删除数据
-- 删除 gender 为女的员工
delete from employee where gender = '女';-- 删除所有员工
delete from employee;
总结