Lets take an example that we have two table one have record of students and other have id which have to delete in table 1, so we write query like this:-
DELETE FROM table_1 WHERE id IN (SELECT id FROM table_2);
Above query will delete all the record from table 1 which have id in table 2.
Check out our SIP CALCULATOR
Check out more PHP tutorials