query to delete multiple(4 to 5) tables in the database using the join condition because tables are having dependency with each other