As far as the database itself is concerned (as this question is on database design), there are really only two types of relationship: 1:1
and 1:0..1
. A foreign key is either nullable or not nullable.
If you count the inverse relationship then there is also one-to-many (1:N
).
Of course, you can implement different kinds of relationships with constraints, but the possibilities are almost infinite; to know which ones you have to "think about", you'd have to know the domain model.
Update: I thought maybe it would be useful to explain how these match up to the other, more UML-esque relationships you listed. In this list, 1:N
means that the RS entity has a nullable or non-nullable foreign key/association with the LS entity:
(0-m):(0-n) - AKA M:N, this is just a combination of 1:N and 1:M with the latter inverted, i.e. (1:N)(M:1)
m:n - Same as above with check: M >= 1 and N >= 1 (very rare, difficult to implement)
m:1 - Same as 1:N, non-nullable
m:(0-1) - Same as 1:N, nullable
1:max - Same as 1:N with check: N <= max, non-nullable
1:min - Same as 1:N with check: N >= min, non-nullable
1:min-max - Same as 1:N with check: N >= min and N <= max, non-nullable
x:y Same as (1:N)(M:1) with check: N = x and M = y, assuming all N are related to all M (otherwise this is not a valid relationship)
And so on - my point being that databases deal only with the "fundamental" relationships and that any other type of relationship is just a combination of these relationships plus constraints.
Once you get the hang of it, it actually becomes much easier than fussing over multiplicities. Just figure out what's related to what, and in which direction, and implement specific rules later as need be.