Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

How to drop multiple tables from one single database at one command. something like,

> use test; 

> drop table a,b,c;

where a,b,c are the tables from database test.

1 Answer

0 votes
by (40.7k points)

For Example:

Assume table A has two children B and C. Then you can use the following syntax to drop all the tables:

DROP TABLE IF EXISTS B, C, A;

This can be placed at the beginning of the script instead of individually dropping each table.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jan 2, 2021 in SQL by Appu (6.1k points)

Browse Categories

...