This content has been marked as final. Show 1 reply
The SQL syntax for adding a foreign key is
alter table player
add constraint nation_id_fk
foreign key (nation_id)
references nation( nation_id )
This means that the column player.nation_id references the column nation.nation_id. You don't need a new column as the relevant columns already exist.
In the add constraint dialog nation and nation_id are the referenced table and column.
Note that nation.nation_id needs to be a primary key or a unique queue.
Edited by: Jim Smith on Nov 26, 2012 1:04 PM