From the course: Database Foundations: Database Management

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Remove database objects with DROP

Remove database objects with DROP

From the course: Database Foundations: Database Management

Start my 1-month free trial

Remove database objects with DROP

- [Instructor] When tables become obsolete or are otherwise no longer needed in the database, you can get rid of them entirely with a single line of code. In the prior movie, we created a copy of some data and then stored it in a new table called beauty products. Let's take a look at it by expanding the two trees database in the PostgreSQL server and then open up the tables folder. Now I'm not seeing it here, so I'm going to right-click and choose refresh, and there is the table that we created in the last movie. Let's go ahead and remove it from the database now. I'm going to right-click on the two trees database and choose new query. In order to get rid of the table, all we need to do is issue the command drop table. Then we list out what table we want to remove. In this case, it's the inventory.beautyproducts table. After the statement is executed, the table is removed from the database and that's all there is to it. The drop command is the exact opposite of the create command, and…

Contents