How to delete drop multiple tables in AWS athena

0 votes
I cannot run multiple DROP queries at same time. I am trying to drop few tables from Athena. Is there a way to do it? Can anyone help me in this?

Thank you in advance.
Jan 17, 2019 in AWS by Anjali
• 2,950 points
8,255 views

1 answer to this question.

0 votes

It is not possible to run multiple queries in the one request. This is not supported by Athena as of now.

An alternative is to create the tables in a specific database. Dropping the database will then delete all the tables.

CREATE DATABASE db1;
CREATE EXTERNAL TABLE table1 ...;
CREATE EXTERNAL TABLE table2 ...;
DROP DATABASE db1 CASCADE;

The DROP DATABASE command will delete the table1 and table2 tables. This is not the preffered method as it may delete the tables you dont want to delete.

Hope this helps you.

answered Jan 17, 2019 by Edureka
• 4,220 points

Related Questions In AWS

0 votes
0 answers

How to get the record count of all tables in athena aws?

I'm trying to figure out how to ...READ MORE

Dec 13, 2022 in AWS by Ashwini
• 5,430 points
2,495 views
+2 votes
1 answer

How to Use Amazon AWS Credentials to Access/Query Tables in AWS RDS Instance through Mobile App

You should make your backend functions to ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
1,336 views
0 votes
2 answers

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14, 2019 in AWS by athenauserz
11,887 views
0 votes
1 answer

How to set Multiple locations in Athena?

Unfortunately you can use athena with just ...READ MORE

answered Jan 16, 2019 in AWS by william
4,013 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How can I create tables in Athena?

Creating tables in Athena is very easy. ...READ MORE

answered Jan 17, 2019 in AWS by Edureka
• 4,220 points
1,488 views
0 votes
1 answer

How to update or insert data using Athena?

Athena is a query language and as ...READ MORE

answered Jan 17, 2019 in AWS by Edureka
• 4,220 points
12,127 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP