Please have a look at the below diagram image.
That image represents the "One to Many" relationship. It says "Client is introduced by Introducer". Client can have 1 Introducer or non at all, but Intrudcer can have many clients.
So even though it is "Client can have 1 Introducer or non at all", it is still described in ER Diagrams as a one to many relationship right? I am little worried about this "non at all" part, as far as I know "One to many relationship" describes that scenario as well. I am bit confused on this, having a look at diagrams after some time!
One-to-many relations only states (in your example diagram) that ONE client could have only ONE introducer (this is the ONE part of the One-to-many). (A client could be introduced by only one introducer). The MANY part states that one Introducer could introduce zero, one or any number of clients. A client can contact you without any introduction.
You are right, the one-to-many relationship could be confusing, but is there any relationship if there is no introducer for a client? (No there is no relation).
In the above example, if the Introducer_id
column in the Client
table is nullable, the relationship is not a requirement, so there could be one or more clients who has no introducer.
The relationship could be required, if the foreign key column is not nullable (The NOT NULL
constraint is present on the field).
So the relationship and its cardinality is defined by the FOREIGN KEY
and the NOT NULL
constraints on the 'many' side's columns.
The ER diagram represents the cardinality of the relationship when the relationship actually exists. (How can you represent that there is no relation?)