How to delete record data from another table id – MySQL

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

How to reverse value of integer or string in php?
No input file specified - Codeigniter