lets say you have categories and products,
your products table has a relational field called category_id, so in other words each product belongs to 1 category. Categories have multiple products. Then lets say products also have multiple stock levels in an inventory level table, since our products exists at more then one warehouse
so categories have many products, products have many levels of stock levels. In innodb you can tell the database this, by setting up your relational fields. You can then tell the database that if a category is deleted all its products, and inventory level entries should be deleted. In your code you just delete the category and innodb handles the rest. This is called a cascade
Otherwise your code will need to first select all the products, loop through the products and select all the stock levels, then delete all the stock levels, delete all the products and finally delete the category.
Instead of deleting the sub-products you could re-assign them to the default category_id, or give the user a choice of action
http://dev.mysql.com/doc/refman/5.0/en/ ... aints.html
Edit: phpmyadmin also provides a useful GUI for setting up cascade deletes.