For a foreign key consisting of several columns, it is possible that one of the columns contains a value for which the reference columns do not have a corresponding value, according to the SQL-92 standard. To avoid this situation, create NOT NULL constraints for all foreign key columns.
for reference
so I think you can insert data into one of the rows without specifying the value in the foreign key column, and then insert the row into the row value of the second primary key in the first table, and then you can continue ...
source share