H2 Database 简明教程
H2 Database - Drop
DROP 是从通用 SQL 语法中获取的命令。此命令用于从内存中删除数据库组件及其结构。本章将讨论使用 Drop 命令的不同情况。
DROP is a command taken from the generic SQL grammar. This command is used to delete a database component and its structure from the memory. There are different scenarios with the Drop command that we will discuss in this chapter.
Drop Table
Drop Table 是一个删除相应表及其结构的命令。
Drop Table is a command that deletes the respective table and its structure.
Syntax
以下是 Drop Table 命令的通用语法。
Following is the generic syntax of the Drop Table command.
DROP TABLE [ IF EXISTS ] tableName [,...] [ RESTRICT | CASCADE ]
如果我们正在使用 RESTRICT 并且该表具有从属视图,则该命令将失败。当我们使用 CASCADE 关键字时,所有从属视图都将被删除。
The command will fail if we are using RESTRICT and the table having dependent views exist. All dependent views are dropped, when we are using CASCADE keyword.
Drop Schema
Drop Schema 是一条从数据库服务器删除相应模式的命令。它不会在当前模式中运行。
Drop Schema is a command that drops a respective schema from the database server. It will not work from the current schema.
Drop Sequence
Drop Sequence 是一条用于从表结构中删除序列的命令。
Drop Sequence is a command used to drop a sequence from the table structure.
Drop View
Drop View 是一条用于删除现有视图的命令。如果使用了 CASCADE 子句,所有依赖的视图也会被删除。
Drop View is a command used to drop the existing view. All dependent views are dropped as well if the CASCADE clause is used.