SQL DROP TABLE 和 TRUNCATE TABLE 关键字
DROP TABLE
The DROP TABLE
command deletes a table in the database. (DROP TABLE 命令用于删除数据库中的表。)
The following SQL deletes the table "Shippers" (以下 SQL 语句删除 "Shippers" 表)
示例
DROP TABLE Shippers;
Note: Be careful before deleting a table. Deleting a table results in loss of all information stored in the table! (注意:删除表前请务必小心。删除表将导致其中存储的所有信息丢失!)
TRUNCATE TABLE
TRUNCATE TABLE
命令删除表中的数据,但不删除表本身。
以下 SQL 截断了 "Categories" 表:
示例
TRUNCATE TABLE Categories;