?zero-to-many? Doesn't that mean there's NO relationship between the
tables? <g>
A One-to-Many relationship means, for example, that one person (the One
side) may have zero-to-many driver's license numbers (the Many), but that
any one driver's license number belongs to one and only one person.
It is sometimes called a parent-child relationship, but this can be
misleading, since a child would have, issues of cloning aside, more than one
parent (at least genetically).
Could you describe your subject area further?
Good luck
Jeff Boyce
<Access MVP>
>.
>
>tblBorrower has fields lngBorrowerNumberCnt and
>strBorrowerName. tblLoan has fields strISBN,
>lngBorrowerNumberCnt and dtmDateBorrowed. A borrower can
>have anything from Zero-To-Many books at any one time.
>
This is a perfectly normal one to many relationship. There is *ONE*
borrower, and an arbitrary number of lent books; it's just a jargon
limitation. "One To Many" really means "One To {zero, one, or more}".
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
Zero-to-Many, as John Vinson has already pointed out, is just a normal
1-to-many relationship.
This is confusing if you are coming from UML notation, for example, or
crow's foot notation. For example, in UML notation, "0..*" as an
aggregation attribute means "there are 0 or more instances for each
instance of the containing object", and "1..*" means: "For each
instance of the containing object, there must be at least one instance
of the contained object".
In relational DB design, "1-to-many" means there can be only one
master record, but 0 or more detail records. "1-to-1" is especially
confusing because that means there can be AT MOST one detail record,
but 0 is also allowed, for each master record.
To enforce the existence of at least 1 detail record for each master
record, you have to resort to other means than RI because you must
always insert the master record BEFORE any detail records, so it is
impossible to enforce existence of the detail record at the engine
level.
Bob Hairgrove
rhairgro...@Pleasebigfoot.com
As I think John has said this is a perfectly normal
relationship.
What you're trying to define is the optionality of the
relationship.
A 1:M relationship between borrower and loan means 1
borrower can have many loans.
However, what I think you are saying is that while this is
true, it is also true that a borrower does not HAVE TO
have a loan. This is known as a Borrower having an
optional 1:M with Loan, i.e. it can have none (the
relationship simply isn't implemented) one or many loans.
Good news: it is standard for the table at the one end of
the relationship to be optional.
It is actually very difficult (impossible?) to specify a
mandatory relationship for the table at one end of a 1:M
relationship without programming support.
For the table at the many end it is very easy: NOT NULL on
the foreign key give you mandatory, NULL on the foreign
key gives you optional.
Eldon.