Reputation: 446
I'm confusing about 0:M relationship.
So, I want to ask about that.
Assumes we have 2 tables :
Contact which has attributes like : ContactID(PK), Name
Address which has attributes like : AddressID(PK), Desc, ContactID(FK to Contact, Nullable, Not Unique)
Is my statement right that :
The 0:M relationship occurred when there is 1 row in Contact and it's ContactID don't appear in Address.
To make the 0:M relationship Column ContactID in Table Address must be nullable.
Thanks in advance
Upvotes: 0
Views: 368
Reputation: 25436
The 0:M
notation is used to annotate one side of a relationship, indicating its cardinality. It is a range and is accurate in every instance of the relationship. When ContactID doesn't occur in address, the cardinality is 0.
Foreign keys don't need to be nullable, and shouldn't in general. The 0 case still happens, when a ContactID occurs in Contact and not Address.
Upvotes: 1