One to one relationship naming conventions

database-design

I'm designing an ER diagram with MySQL Workbench.

I have two tables with a one-to-one relationship. Both tables have one column as primary key, but they don't have the same name.

Take a look:

enter image description here

But when I have added the relationship, it has added automatically the column Code_CodeId.

Is there a naming convention about how can I name primary columns with a one-to-one relationship? Do must have the same name? Why it has added that column?

Best Answer

Is there a naming convention about how can I name primary columns with a one-to- one relationship?

I am sure there are plenty of them. Choose one.

For example, I would name the reference

CodeREF

And if having multiple I would use describtive names as per the objects that I will manifest (RawCoderREF, ReviewedCodeREF)