mysql 练习基础 9:删除数据并手动导入数据
2021/10/10 16:50:35
本文主要是介绍mysql 练习基础 9:删除数据并手动导入数据,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
truncate table orders;-- 删除表orders数据 #删除数据 # delete from 表名[ where 删除条件]; # truncate 表名;(与delete from 表名一样,都是删除表中全部数据,保留表结构) #delete和truncate的区别: #dlete可以添加where子句删除表中部分数据,truncate只能删除表中全部数据 #dlete删除表中数据保留表结构,truncate直接把表删除(drop table)然后再创建一张新表(create table),执行速度比delete快。 insert into orders values ("o01","u01","c01","2021-10-1"), ("o02","u01","c01","2021-10-2"), ("o03","u01","c01","2021-10-2"), ("o04","u02","c02","2021-10-03"), ("o05","u03","c02","2021-10-30"), ("o06","u03","c02","2021-10-01"), ("o07","u04","c03","2021-10-03"), ("o08","u04","c03","2021-10-04"), ("o09","u04","c03","2021-10-04"), ("o10","u04","c03","2021-10-06"); select * from orders;-- 查看导入数据结果
这篇关于mysql 练习基础 9:删除数据并手动导入数据的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-25如何部署MySQL集群资料:新手入门教程
- 2024-12-24MySQL集群部署资料:新手入门教程
- 2024-12-24MySQL集群资料详解:新手入门教程
- 2024-12-24MySQL集群部署入门教程
- 2024-12-24部署MySQL集群学习:新手入门教程
- 2024-12-24部署MySQL集群入门:一步一步搭建指南
- 2024-12-07MySQL读写分离入门:轻松掌握数据库读写分离技术
- 2024-12-07MySQL读写分离入门教程
- 2024-12-07MySQL分库分表入门详解
- 2024-12-07MySQL分库分表入门指南