I have fifty tables in a database, in that I need only six tables.
How can I delete remaining tables by one single query?
You can generate a list of DROP TABLE commands with the query below:
SELECT 'DROP TABLE ' || table_name || ';' FROM user_tables;
After that you remove your six tables you want to keep and execute the other commands. Or you add a WHERE table_name NOT IN (...)
clause to the query.
Hope it helps.