dbTalk Databases Forums  

Examples for one-to-one associations?

comp.databases.theory comp.databases.theory


Discuss Examples for one-to-one associations? in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-07-2010 , 06:04 PM






On Mon, 7 Jun 2010 11:05:44 -0700 (PDT), Nilone <reaanb (AT) gmail (DOT) com>
wrote:

Quote:
On Jun 5, 12:33*pm, Karsten Wutzke <kwut... (AT) web (DOT) de> wrote:
can anyone give me some *real-world* examples for one-to-one
associations

Sometimes, corporations/agencies/governments require exclusive
associations - a employee may not hold multiple positions or
occupations, a professor may not chair more than one department, etc.
In addition, in resource allocation problems, associations between
resources at any particular time often excludes others of the same
kind - we may only assign one parking space (or one driver) to one
vehicle at a time, a teacher can only teach one subject to one class
in one room, and so on.
1-1 is rather strict. On the course example, I had plenty of
courses where the instructor taught the one course to one class in TWO
rooms: one for theory and one for labs. I also had a few where the
course was in different rooms at different times including one case
where for one day of the week, the first hour was in one room and the
next hour was in another building.

Quote:
But are there any real one-to-one, loosely coupled associations?

Your own examples with cars and engines illustrate that association,
aggregation and composition conflate the relation with a mereological
interpretation. The recent threads on IS-A and HAS-A in this group
contain my own struggles with them. Instead, unique constraints and
referential constraints on relations can express logical requirements
precisely and sufficiently.

If so, who references who in a relationship between two equivalently
positioned/leveled entities?

A one-to-one relationship exists equally between both. Why do you
want to allocate ownership of the relationship to either entity?
I missed this at first myself. Presumably, there is a PK for
both tables. Use that to access the two tables.

The answer to Karsten Wutzke's question is whichever is
convenient. Taking a case of husband and wife, sometimes, the husband
is the way to the couple, and sometimes, it is the wife.

Sincerely,

Gene Wirchenko

Reply With Quote
  #12  
Old   
Nilone
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-08-2010 , 04:25 AM






On Jun 8, 1:04*am, Gene Wirchenko <ge... (AT) ocis (DOT) net> wrote:
Quote:
* * *1-1 is rather strict. *On the course example, I had plenty of
courses where the instructor taught the one course to one class in TWO
rooms: one for theory and one for labs. *I also had a few where the
course was in different rooms at different times including one case
where for one day of the week, the first hour was in one room and the
next hour was in another building.
Agreed.

Quote:
A one-to-one relationship exists equally between both. *Why do you
want to allocate ownership of the relationship to either entity?

* * *I missed this at first myself. *Presumably, there is a PK for
both tables. *Use that to access the two tables.
I disagree with your assumption of two tables, although I suspect such
an assumption lead to the original question of "who references who".
On the level of modelling the system or domain, we don't need tables
at all. As for the implementation, I don't see any reason to choose a
two table design yet. In fact, without further information, I would
choose to represent the relationship in 6NF, i.e. give it its own
table.

Reply With Quote
  #13  
Old   
Keith H Duggar
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-08-2010 , 08:23 AM



On Jun 7, 2:25*pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:
Quote:
Gene Wirchenko wrote:
On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill
chase.saund... (AT) gmail (DOT) com> wrote:

Examples of one to ones:

1) Spouse

* * *You need a time element. *Even given monogamy, many peoplehave
been married more than once.

Even more basic than that: Some folks are single.
Why is that an issue? If a person is single then they would not appear
in the Spouse relation. one-to-one relations can be partial can they
not?

KHD

Reply With Quote
  #14  
Old   
Bob Badour
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-08-2010 , 08:29 AM



Keith H Duggar wrote:

Quote:
On Jun 7, 2:25 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Gene Wirchenko wrote:

On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill
chase.saund... (AT) gmail (DOT) com> wrote:

Examples of one to ones:

1) Spouse

You need a time element. Even given monogamy, many people have
been married more than once.

Even more basic than that: Some folks are single.

Why is that an issue? If a person is single then they would not appear
in the Spouse relation. one-to-one relations can be partial can they
not?
The relative cardinality is 1:zero-or-one not 1:1.

Reply With Quote
  #15  
Old   
Erwin
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-08-2010 , 08:48 AM



On 7 jun, 20:05, Nilone <rea... (AT) gmail (DOT) com> wrote:
Quote:
On Jun 5, 12:33*pm, Karsten Wutzke <kwut... (AT) web (DOT) de> wrote:


Instead, unique constraints and
referential constraints on relations can express logical requirements
precisely and sufficiently.
This reply just to suggest that it might be better if the world learnt
to talk just of "database constraints", of which both 'uniqueness
constraints' and 'referential constraints' are merely a very small
subset.

After all, we do now live in a world in which it has recently
(cosmological timescale) become possible to enforce just any arbitrary
database constraint efficiently.

Ego dixi.

Reply With Quote
  #16  
Old   
Erwin
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-08-2010 , 08:50 AM



On 7 jun, 20:14, Gene Wirchenko <ge... (AT) ocis (DOT) net> wrote:
Quote:
On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill

chase.saund... (AT) gmail (DOT) com> wrote:
Examples of one to ones:

1) Spouse

* * *You need a time element. *Even given monogamy, many people have
been married more than once.
And in the case of Lizzie Taylor, even more than once with the same
victim ...

Reply With Quote
  #17  
Old   
Keith H Duggar
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-18-2010 , 10:07 AM



"partial injective function"

On Jun 8, 9:29*am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:
Quote:
Keith H Duggar wrote:
On Jun 7, 2:25 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Gene Wirchenko wrote:

On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill
chase.saund... (AT) gmail (DOT) com> wrote:

Examples of one to ones:

1) Spouse

* * You need a time element. *Even given monogamy, many people have
been married more than once.

Even more basic than that: Some folks are single.

Why is that an issue? If a person is single then they would not appear
in the Spouse relation. one-to-one relations can be partial can they
not?

The relative cardinality is 1:zero-or-one not 1:1.
I don't think that is correct. The cardinality is defined by the
domain definitions of the relation, not by the current extent of
the relation. Further, since we are not dealing with multivalued
theory the cardinality is never of the form "C1:C2 or C1:C3 ..."
for a particular domain and relation (where C# are cardinals);
rather it is fixed at some C1:C2 regardless of the current
extension.

As far as I know, in mathematics the properties "injective" (ie
one-to-one) and "partial" are not mutually exclusive. Please Google
"partial injective function" to find both definitions and examples
of such functions. For example, the square root function over the
natural numbers is considered a partial injective function.

KHD

Reply With Quote
  #18  
Old   
Bob Badour
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-18-2010 , 03:49 PM



Keith H Duggar wrote:

Quote:
"partial injective function"

On Jun 8, 9:29 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Keith H Duggar wrote:

On Jun 7, 2:25 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Gene Wirchenko wrote:

On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill
chase.saund... (AT) gmail (DOT) com> wrote:

Examples of one to ones:

1) Spouse

You need a time element. Even given monogamy, many people have
been married more than once.

Even more basic than that: Some folks are single.

Why is that an issue? If a person is single then they would not appear
in the Spouse relation. one-to-one relations can be partial can they
not?

The relative cardinality is 1:zero-or-one not 1:1.

I don't think that is correct. The cardinality is defined by the
domain definitions of the relation, not by the current extent of
the relation. Further, since we are not dealing with multivalued
theory the cardinality is never of the form "C1:C2 or C1:C3 ..."
for a particular domain and relation (where C# are cardinals);
rather it is fixed at some C1:C2 regardless of the current
extension.

As far as I know, in mathematics the properties "injective" (ie
one-to-one) and "partial" are not mutually exclusive. Please Google
"partial injective function" to find both definitions and examples
of such functions. For example, the square root function over the
natural numbers is considered a partial injective function.
The original question was not about functions (or relations for that
matter) but about "associations" and "entities".

Most (if not all) ER notations have distinct syntax for 1:1.
1:zero_or_1, 1:0_or_more, 1:1_or_more, 0_or_more:0_or_more etc.

0_or_more is your standard "many".

Reply With Quote
  #19  
Old   
Keith H Duggar
 
Posts: n/a

Default Re: Examples for one-to-one associations? - 06-18-2010 , 05:25 PM



On Jun 18, 4:49*pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:
Quote:
Keith H Duggar wrote:
"partial injective function"

On Jun 8, 9:29 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Keith H Duggar wrote:

On Jun 7, 2:25 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Gene Wirchenko wrote:

On Sat, 5 Jun 2010 20:49:59 -0700 (PDT), hoodwill
chase.saund... (AT) gmail (DOT) com> wrote:

Examples of one to ones:

1) Spouse

* *You need a time element. *Even given monogamy, many peoplehave
been married more than once.

Even more basic than that: Some folks are single.

Why is that an issue? If a person is single then they would not appear
in the Spouse relation. one-to-one relations can be partial can they
not?

The relative cardinality is 1:zero-or-one not 1:1.

I don't think that is correct. The cardinality is defined by the
domain definitions of the relation, not by the current extent of
the relation. Further, since we are not dealing with multivalued
theory the cardinality is never of the form "C1:C2 or C1:C3 ..."
for a particular domain and relation (where C# are cardinals);
rather it is fixed at some C1:C2 regardless of the current
extension.

As far as I know, in mathematics the properties "injective" (ie
one-to-one) and "partial" are not mutually exclusive. Please Google
"partial injective function" to find both definitions and examples
of such functions. For example, the square root function over the
natural numbers is considered a partial injective function.

The original question was not about functions (or relations for that
matter) but about "associations" and "entities".

Most (if not all) ER notations have distinct syntax for 1:1.
1:zero_or_1, 1:0_or_more, 1:1_or_more, 0_or_more:0_or_more etc.

0_or_more is your standard "many".
Oh ok. Don't know how I got sidetracked onto relations ;-)

KHD

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.