I’m relatively new to SQL and I’m not sure how to do a one to one relationship. Having read about the first 3 forms of normalization, I’m currently under the impression that the best way to do this would be to have an intermediary table, ala-3rd from many to many relationships, except each column being declared unique.
Share
Something like this might be a good reason/way to do a one-to-one relationship but normally you would just have all your data in one table where each row is what defines the relationship.
One reason for separating them might be to limit access to a specific table for a user while allowing access to other data for that key field.
Another possible reason for having a separate table for a one-to-one relationship is when you do not wish to have
nullin your column. For instance, if 90% of the data will be null, you may be better off with a completely separate (and smaller) table and joining that field on the PK instead. This is actually considered to be an “optional one-to-one relationship” because you do not truly have one record for every possible relationship.