I will give 2 tables of a database: User and Address. where the user has the idEndereco attribute as the foreign key of the address table. The ids are with AUTO INCREMENT, yet, how do I know what the foreign key value of the address is? Will I have to do the insert in address, and then make a select to be able to get its primary key? Is there a more effective method?