🌈个人主页: Aileen_0v0
🔥热门专栏: 华为鸿蒙系统学习|计算机网络|数据结构与算法
💫个人格言:“没有罗马,那就自己创造罗马~”
INSERT INTO表名(字段名1,字段名2,...)VALUES(值1,值2,...); | |||||||
insert into employee(id, workno, name, gender, age, idcard, entrydate) values (1,'1','Itcast','女',10,'123456789101111111','2003-01-01'); select * from employee;
INSERT INTO表名VALUES(值1,值2,...); | |||||||
insert into employee(id, workno, name, gender, age, idcard, entrydate) values (1,'1','Itcast','女',10,'123456789101111111','2003-01-01'); select * from employee; insert into employee values (2,'2','ling','男',22,'123456789102222222','2024-1-27');
INSERT INTO表名(字段1,字段2,...)VALUES(值1,值2,...),(值1,值2,...),(值1,值2,...); | |||||||
INSERT INTO表名VALUES(值1,值2,...),(值1,值2,...),(值1,值2,...); | |||||||
insert into employee values (3,'3','lin','男',33,'123456789106666666','2012-09-09');
UPDATE 表名 SET 字段名1 = 值1,字段名2 = 值2,......[WHERE 条件]; | |||||||
-- 修改id为1 的数据, 将name修改为itAileen update employee set name = 'itAileen' where id = 1;
-- 修改id为1 的数据, 将name修改为 小玲, gender 修改为 女 update employee set name = '小玲',gender = '女' where id = 1;
-- 修改所有的员工的入职日期为 2008-01-01 update employee set entrydate = '2008-01-01';
DELETE FROM 表名[WHERE 条件]; | |||||||
-- 删除 gender 为女的员工 delete from employee where gender = '女';
-- 删除所有员工 delete from employee;