So let's say we have this situation:

I know this means that foreign key fk1 can be assigned to only one primary key id2 and likewise (meaning there cannot be duplicates of fk1 values in table1 as far as I understand, please correct me if I am wrong). Now I am having a dilemma whether there can exist values in table2 that are not yet assigned to any foreign key in table1 or not. Practically I suppose that values CAN exist in table2 without being assigned to any of foreign keys in table1 (and that it depends on the DBMS used), but theory I read so far about these arrows does not acknowledge this really clear. My friend is telling me that the described situation should be represented like this:

and not like in the first picture. Now for this picture, again, I suppose this means that there can be values in table1 that have fk1 as NULL and that there cannot be duplicates of fk1 in table1. Is this the correct assumption or not?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.