-- 查询所有数据
SELECT * FROM stu;
-- 给指定列添加数据 INSERT INTO 表名(列名1,列名2,...) VALUES(值1,值2,...);
INSERT into stu(id,name,sex,birthday,score,email,tel,status) values(3,'李四','男','2000-11-11',88.88,'qq.com','18100000000',1);
-- 给所有列添加数据,可以不写列名,不建议
INSERT into stu values(2,'李四','男','2000-11-11',88.88,'qq.com','18100000000',1),(2,'李四','男','2000-11-11',88.88,'qq.com','18100000000',1),(2,'李四','男','2000-11-11',88.88,'qq.com','18100000000',1);
-- 修改数据 UPDATE 表名 SET 列名1=值1,列名2=值2,... [WHERE 条件];
-- 将张三的性别改为女
UPDATE stu set sex = '女' WHERE name = '张三';
-- 注意,如果没有加 where 条件,则会将所有数据全部修改
SELECT * FROM stu;
UPDATE stu set sex = '女';
-- 删除 DELETE FROM 表名 [WHERE 条件];
-- 删除张三
DELETE FROM stu WHERE name = '张三';
DELETE FROM stu;
标签:总结,11,--,qq,列名,stu,4.21,88.88 From: https://www.cnblogs.com/XiMenXve/p/17341085.html