MySQL has features when it comes to linked tables. For instance in your case if you delete a menu then all linked sub-menus will also be deleted. You can read up on this.
However if you database is simple you can simply run 2 queries. Delete the single record from the parent table, then delete records from the linked table using the parent tables' primary key i.e
DELETE FROM menus WHERE menuId=1
DELETE FROM sub_menus WHERE menuId=1 (menuId is the foreign key)
If you are deleting a record in the sub_menu table nothing needs to happen in the primary table because it is a one to many join. i.e. 1 menu can have many sub menus.
You should never leave records in a table that are disjointed as your tables will end up cluttered with rubbish and it could cause issue.