![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have "1 <-> 0..1 relationship". For example: There is a set of users. Some users are customers. Thus we have two tables: the table `users` and the table `customers`. What is the best way to express this in a relational database: 1. In the table `users` add the `customer` field which may be either a ref to `users` or NULL. 2. In the table `customers` add UNIQUE `user` field which refers to `users` table. I have already asked a similar question in some forums, but the answer was basically "whatever you need", "whatever you think convenient". I don't like this kind of answer. I want a serious piece of DB theory instead, a well founded answer. Where to read about 1 <-> 0..1 relationships? |
![]() |
| Thread Tools | |
| Display Modes | |
| |