How to delete multiple tables data in Oracle?

You can use the DELETE statement to remove data from multiple tables. The basic syntax of the DELETE statement is as follows:

DELETE FROM table_name1, table_name2
WHERE condition;

In this case, table_name1 and table_name2 are the names of the tables from which data will be deleted, and condition is the criteria for deleting the data.

For example, suppose you have two tables named table1 and table2, and you want to delete all records in table1 and table2 where the age is greater than 30, you can use the following statement:

DELETE FROM table1, table2
WHERE table1.age > 30 AND table2.age > 30;

Caution, deleting data is a risky operation so please use it carefully. Before executing a DELETE statement, it is best to back up the data to prevent accidentally deleting it.

bannerAds