欢迎来到 AI 中文社区(简称 AI 中文社),这里是学习交流 AI 人工智能技术的中文社区。 为了更好的体验,本站推荐使用 Chrome 浏览器。
全部教程·
数据库·
Sqlite
[目录]
·
SQLite 删除表
SQLite教程
SQLite 安装
SQLite 命令
SQLite 语法
SQLite 数据类型
SQLite 创建数据库
SQLite 附加数据库
SQLite 分离数据库
SQLite 创建表
SQLite 删除表
SQLite Insert 语句
SQLite Select 语句
SQLite 运算符
SQLite 表达式
SQLite Where 子句
SQLite AND/OR 运算符
SQLite Update 语句
SQLite Delete 语句
SQLite Like 子句
SQLite Glob 子句
SQLite Limit 子句
SQLite Order By
SQLite Group By
SQLite Having 子句
SQLite Distinct 关键字
SQLite PRAGMA
SQLite 约束
SQLite Join
SQLite Unions 子句
SQLite NULL 值
SQLite 别名
SQLite 触发器
SQLite Indexed By
SQLite Alter 命令
SQLite Truncate Table
SQLite 视图
SQLite 事务
SQLite 子查询
SQLite Autoincrement
SQLite 注入
SQLite Explain
SQLite Vacuum
SQLite 日期 & 时间
SQLite 常用函数
SQLite C/C++ 接口
SQLite Java 接口
SQLite PHP 接口
SQLite Perl 接口
SQLite Python 接口
SQLite教程
SQLite 安装
SQLite 命令
SQLite 语法
SQLite 数据类型
SQLite 创建数据库
SQLite 附加数据库
SQLite 分离数据库
SQLite 创建表
SQLite 删除表
SQLite Insert 语句
SQLite Select 语句
SQLite 运算符
SQLite 表达式
SQLite Where 子句
SQLite AND/OR 运算符
SQLite Update 语句
SQLite Delete 语句
SQLite Like 子句
SQLite Glob 子句
SQLite Limit 子句
SQLite Order By
SQLite Group By
SQLite Having 子句
SQLite Distinct 关键字
SQLite PRAGMA
SQLite 约束
SQLite Join
SQLite Unions 子句
SQLite NULL 值
SQLite 别名
SQLite 触发器
SQLite Indexed By
SQLite Alter 命令
SQLite Truncate Table
SQLite 视图
SQLite 事务
SQLite 子查询
SQLite Autoincrement
SQLite 注入
SQLite Explain
SQLite Vacuum
SQLite 日期 & 时间
SQLite 常用函数
SQLite C/C++ 接口
SQLite Java 接口
SQLite PHP 接口
SQLite Perl 接口
SQLite Python 接口
SQLite 删除表
SQLite 的 DROP TABLE 语句用来删除表定义及其所有相关数据、索引、触发器、约束和该表的权限规范。
使用此命令时要特别注意,因为一旦一个表被删除,表中所有信息也将永远丢失。
1. 语法
DROP TABLE 语句的基本语法如下。您可以选择指定带有表名的数据库名称,如下所示:
DROP TABLE database_name.table_name;
2. 范例
让我们先确认 COMPANY 表已经存在,然后我们将其从数据库中删除。
sqlite>.tables COMPANY test.COMPANY
这意味着 COMPANY 表已存在数据库中,接下来让我们把它从数据库中删除,如下:
sqlite>DROP TABLE COMPANY; sqlite>
现在,如果尝试 .TABLES 命令,那么将无法找到 COMPANY 表了:
sqlite>.tables sqlite>
显示结果为空,意味着已经成功从数据库删除表。
下一章:SQLite Insert 语句
SQLite 的 INSERT INTO 语句用于向数据库的某个表中添加新的数据行。 1. 语法INSERT INTO 语句有两种基本语法,如下所示:INSERT INTO TABLE_NAME ...
AI 中文社