I have two tables in a SQL database:
You can use
auto_increment in all three!
In particular, you want to use
auto_increment in both the
Brokers tables. This will give you, respectively, a unique
UnderwriterId for each underwriter and a unique
BrokerId for each broker.
The junction table should then use these ids. The junction table can also have its own id. I would add one there, but a unique id in a junction table is less important than in the entity tables.