Suppose one office is closed and you want to remove all employee records in the employees table associated with that office and also the office itself in the offices table, you can use the second form of the MySQL DELETE statement
The following query removes the office record with the code is 1 in the offices table and also all employee records associated with the office 1 in the employees table: