Skip to content
Advertisement

Tag: data-modeling

Database design, which table has the foreign key

I have an Table USER (USER_ID, PASSWORD, NAME, …) and an Table ACCESS_ROLES for the Users, every user can have one ACCESS_ROLE (ONE-TO-ONE). Which table has the Foreign Key? I would put the USER_ID into ACCESS_ROLES table. Is there any best practice approach? Answer Since you will be having a one-to-one relationship, the solution suggested by Philip Kelley is better.

Advertisement