Let us say that I am designing a database for a scenario where there exists a one-to-zero-or-one (1-0..1) relationship. For example:
- There is a set of Users, and some Users may also be Customers.
Thus, I created the two corresponding tables,
…What is the best way to represent and implement this situation in a given SQL platform? I have considered two possible solutions:
userstable, add the
customercolumn which may be either a FOREIGN KEY reference to
customerstable, include a
usercolumn (set with a
UNIQUEconstraint) which points to the
I have already asked a similar question in some forums, but the answer was basically “whatever you need”, “whatever you think convenient”. I do not like this kind of answer. I want a serious piece of DB theory instead, a well founded answer. Where can I read about 1-0..1 relationships?