SQL: Creating Databases and Tables - DROP TABLE

DROP TABLE

The DROP TABLE statement removes an existing table from the database.

Syntax:

-- DROP TABLE
DROP TABLE [IF EXISTS] table_name

Example: DROP Table

-- Create 
CREATE TABLE test_two(
test_id serial PRIMARY KEY);
## data frame with 0 columns and 0 rows
-- Select
SELECT * FROM test_two;
## data frame with 0 columns and 0 rows
-- DROP Table
DROP TABLE test_two;
## data frame with 0 columns and 0 rows
-- Select
SELECT * FROM test_two;
## NULL
-- DROP Table with exists
DROP TABLE IF EXISTS test_two;
## data frame with 0 columns and 0 rows