Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Zero-To-Many Relationship

4,037 views
Skip to first unread message

martin placek

unread,
Jan 25, 2003, 6:32:34 AM1/25/03
to
Hi
I have two tables related by a Zero-To-Many Relationship,
but i am not sure how to configure this on the Edit
Relationships dialog box. Can anyone help please?
Martin

Jeff Boyce

unread,
Jan 25, 2003, 9:21:11 AM1/25/03
to
Martin

?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>

martin placek

unread,
Jan 25, 2003, 11:54:17 AM1/25/03
to
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.

>.
>

John Vinson

unread,
Jan 25, 2003, 1:59:16 PM1/25/03
to
On Sat, 25 Jan 2003 08:54:17 -0800, "martin placek"
<martin...@yahoo.com> wrote:

>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

Bob Hairgrove

unread,
Jan 26, 2003, 5:47:27 AM1/26/03
to

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

Eldon

unread,
Jan 27, 2003, 5:46:47 PM1/27/03
to

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.

0 new messages