The DROP TABLE
statement is used to drop an existing table in a database.
Note: Be careful before dropping a table. Deleting a table will result in loss of all information stored in the table!
The following SQL statement drops the existing table cars
:
Delete the cars
table:
DROP TABLE cars;
DROP TABLE
To check the result we can display the table with this SQL statement:
SELECT * FROM cars;
Which will result in an error, because the cars
table no longer exists:
ERROR: relation "cars" does not exist
LINE 1: SELECT * FROM cars;
^
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!