“One-To-Many” Relationships
One row in the first primary
table connects to
many rows in a secondary
(“foreign”) table.
One of the tables contains the “primary” key.
The other table contains the “foreign” key.
In a “One-to-Many” relationship,
the “One” side contains the “primary” key,
and the “Many” side
contains the “foreign” key.
One customer may have many orders.
One driver may have many traffic tickets.
One student may take many classes.
One instructor may teach many classes
One artist may have many CDs.
In each of these examples,
there must be one on the “one” side,
but the “many” side can actually be any number, even zero !
Think about that :
One customer may have no orders.
One driver may have no traffic tickets.
One student may take no classes.
One
instructor may teach no classes
One artist may have no CDs.
So, “many”
really means anything : none, one, two, or as many as needed.
In other words :
A driver can have one ticket, two tickets, 27 tickets, or no tickets at all.
A customer can have one order, two orders, 27 orders,
or no orders at all.