drop_table 中文man页面

系统
DROP TABLE 从数据库中删除表或视图。 只有其所有者才能删除一个表或视图。要清空一个表,而不删除表, 使用 DELETE。

NAME

DROP TABLE - 删除一个表

SYNOPSIS

DROP TABLE name [, ...] [ CASCADE | RESTRICT ]

DESCRIPTION 描述

DROP TABLE 从数据库中删除表或视图。 只有其所有者才能删除一个表或视图。要清空一个表,而不删除表, 使用 DELETE。

DROP TABLE 总是删除目标表上现有的任何索引, 规则,触发器以及约束。但是,要删除一个由另外一个表用外键约束引用的表, 我们必须声明 CASCADE。(CASCADE 将删除外键约束,而不是另外一个表。)  

PARAMETERS 参数

name

 要删除的现存表的名字(可以有模式修饰)。
CASCADE

 自动删除依赖于表的对象。(比如视图)。
RESTRICT

 如果存在依赖对象,则拒绝删除该表。这个是缺省。

EXAMPLES 例子


 删除 films 和 distributors表:

DROP TABLE films, distributors;

COMPATIBILITY 兼容性


 此命令遵循 SQL 标准。  

SEE ALSO 参见

ALTER TABLE [alter_table(7)], CREATE TABLE [create_table(l)]

#p#

NAME

DROP TABLE - remove a table

SYNOPSIS

DROP TABLE name [, ...] [ CASCADE | RESTRICT ]

DESCRIPTION

DROP TABLE removes tables from the database. Only its owner may destroy a table. To empty a table of rows, without destroying the table, use DELETE.

DROP TABLE always removes any indexes, rules, triggers, and constraints that exist for the target table. However, to drop a table that is referenced by a foreign-key constraint of another table, CASCADE must be specified. (CASCADE will remove the foreign-key constraint, not the other table entirely.)  

PARAMETERS

name
The name (optionally schema-qualified) of the table to drop.
CASCADE
Automatically drop objects that depend on the table (such as views).
RESTRICT
Refuse to drop the table if any objects depend on it. This is the default.

EXAMPLES

To destroy two tables, films and distributors:

DROP TABLE films, distributors;

COMPATIBILITY

This command conforms to the SQL standard.  

SEE ALSO

ALTER TABLE [alter_table(7)], CREATE TABLE [create_table(l)]

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 14:06:36

DROP AGGREG中文man

2011-08-24 14:25:43

DROP GROUP中文man

2011-08-24 14:40:50

DROP RULE中文man

2011-08-24 14:28:47

DROP INDEX中文man

2011-08-24 14:22:11

DROP FUNCTI中文man

2011-08-24 14:10:10

DROP CAST中文man

2011-08-24 14:13:27

DROP CONVER中文man

2011-08-24 14:31:48

DROP LANGUA中文man

2011-08-24 14:35:33

DROP OPERAT中文man

2011-08-24 14:16:18

DROP DATABA中文man

2011-08-24 14:19:14

DROP DOMAIN中文man

2011-08-24 14:43:21

drop_schema中文man

2011-08-24 14:59:50

drop_user中文man

2011-08-24 15:03:08

drop_view中文man

2011-08-24 14:57:06

drop_type中文man

2011-08-24 14:38:16

DROP OPERAT中文man

2011-08-24 14:46:42

drop_sequen中文man

2011-08-24 14:52:31

drop_trigge中文man

2011-08-24 13:29:20

CREATE TABL中文man

2011-08-24 13:32:56

CREATE TABL中文man
点赞
收藏

51CTO技术栈公众号