I have 3 tables in my postgreSQL
item_table:
id item_id
------------
1 1234
2 5678
account_table:
item_id account_id
----------------------
2 abcd
payment_table:
account_id payment_status
--------------------------
abcd good
Description
- item_id in the account_table is the id of item_table
- account_id of the payment_table is the account_id of account_table
I want to delete the entry from all tables associated with item_id from the item_table
Example : If my item_id is 5678 then I want to delete entries from all tables in which the ids are connected to each other.
How to achieve this in PostgreSQL?