Relational Database Inserts

For a new project of mine I have used two tables that are tightly linked (sadly I can’t show you the tables as its confidential [even column titles]) Any way my queries for getting stuff look like this:


SELECT b.column FROM table_one a, table_two b WHERE b.foreign_key = a.primary_key AND a.column = something

But how would I do an insert like this? The problem I am having is both tables have a primary key, but table_two also has a foreign key (the primary key of table_one) But when I insert data how do I get it so it inserts into both tables but automatically has table_twos foreign key thing set to the equivalent row in table_one.