How to Drop Table in Redshift

Sometimes you may need to remove table or delete table in Amazon Redshift database. In this article, we will look at how to drop table in Redshift.


How to Drop Table in Redshift

It is very easy to drop table in Redshift using DROP TABLE command.

Here is its syntax

DROP TABLE table_name

For example, here is the SQL query to drop table sales(id, amount) in Redshift.

DROP TABLE sales;

Also read : How to Copy Table in Redshift

Please note, once you delete a table in Redshift, you cannot recover it back.

For example, if you drop a table and then try selecting its rows, you will get an error.

# drop table sales;
 DROP TABLE
# select * from sales;
 ERROR:  relation "sales" does not exist
 LINE 1: select * from sales;

So please be very sure and careful when you drop table.

Need a reporting tool for Redshift? Ubiq makes it easy to visualize data in minutes, and monitor in real-time dashboards. Try it Today!

mm

About Ubiq

Ubiq is a dashboard & reporting platform that makes it easy to get insights from data. Build dashboards, charts & reports for your business in minutes. Try it for free today!