Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.4k 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 Jul 24, 2019 in SQL by Tech4ever (20.3k points)

Browse Categories

...