Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Modifying table structure
2. Removing entire tables
Adding NOT NULL constraints
Summary

Instruction

Good. Now, suppose we want to get rid of a table named airplane_ticket which looks like this:

CREATE TABLE airplane_ticket (
  id integer PRIMARY KEY,
  airline varchar(32),
  passenger_id varchar(32),
  route varchar(16)
);

How do we do that? The syntax is quite straightforward:

DROP TABLE airplane_ticket;

Instead of airplane_ticket, you simply need to provide the name of your table. However, be careful! The statement will delete the table along with all the data inside it.

Exercise

We've got a table named company_store. It is a table which keeps information about all the stores a certain clothing company has opened. The table has the columns store_code, address, and opening_year.

Unfortunately, the structure and the data are outdated. As such, you may go ahead and delete the table.

Stuck? Here's a hint!

Simply type:

DROP TABLE company_store;