If the tables are related to each other then why do you need to insert the data in to all three tables?
You just need to insert in to one table and other will get reference from that table.
Lets support, you want to insert the Employee details who is from a particular city, State and Country.
Then you don't need to insert the data for the State and country. You only need to insert it for City as the city belongs to particular state and the state belong to particular country.
So if your scenarios is something else, then you need to insert the records in to first table and then based on the key value you can insert to the second and similarly you can insert to the 3rd table.
Lets suppose, you have the product table, Category table and the customer details.
When the customer buys a product, the data should be inserted to the customer table. What the product bought, should be reduced from the products table as it is sold out and at the same time, the shipment for the product should be inserted to the the shipping table.
So for this type of scenario, first you need to insert in to customer table with the product id. Based on this product id, the Products table will reduce the item by using the delete command and based on this customer id, the new row will be inserted with the product details to the Shipping table.
Hope it will give you some idea in the implementation.
let me know if anything is unclear.
Pawan Awasthi(DNS MVM)
+91 8123489140 (whatsApp), +60 14365 1476(Malaysia)