DROP TABLE

Name

DROP TABLE  --  Removes existing tables from a database データベースから既存のテーブルを削除します。

Synopsis

DROP TABLE name [, ...]
  

入力

name

The name of an existing table or view to drop.

削除する既存のテーブルまたはビューの名前です。

出力

DROP

The message returned if the command completes successfully.

コマンドが正常に終了したときに戻るメッセージです。

ERROR Relation "name" Does Not Exist!

If the specified table or view does not exist in the database.

データベースに指定したテーブルまたはビューが存在しない 場合です。

説明

DROP TABLE removes tables and views from the database. Only its owner may destroy a table or view. A table may be emptied of rows, but not destroyed, by using DELETE.

DROP TABLE はデータベースからテーブルとビューを 削除します。指定されたテーブルまたはビューの所有者のみが削除できます。 DELETE ではテーブルの行が空にされますが、テーブル は削除されません。

If a table being destroyed has secondary indexes on it, they will be removed first. The removal of just a secondary index will not affect the contents of the underlying table.

削除されようとしているテーブルに補助的インデックスが存在 する場合、まずそのインデックスが消去されます。 補助的インデックスの単なる消去では現在のテーブルの内容に 影響を及ぼしません。

注意事項

Refer to CREATE TABLE and ALTER TABLE for information on how to create or modify tables.

テーブルの作成と変更についての情報は、 CREATE TABLEALTER TABLE を参照して下さい。

使用法

To destroy two tables, films and distributors:

二つのテーブル、filmsdistributors を削除します。

DROP TABLE films, distributors;
   

互換性

SQL92

SQL92 specifies some additional capabilities for DROP TABLE:

SQL92 は DROP TABLE にいくつかの追加的機能を明記しています。

DROP TABLE table { RESTRICT | CASCADE }
   

RESTRICT

Ensures that only a table with no dependent views or integrity constraints can be destroyed.

依存関係の有るビューを持たない、あるいは完全性保証制約条件 の付いていないテーブルだけが削除されることを保証します。

CASCADE

Any referencing views or integrity constraints will also be dropped.

参照しているビューまたは完全性保証条件も削除 します。

Tip: At present, to remove a referenced view you must drop it explicitly.

現時点では、参照されたビューを消去するには、 明示的に削除しなければなりません。