 |
|
 |
|
Next: Office Networking
|
| Author |
Message |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 1) Posted: Mon Sep 18, 2006 11:57 am
Post subject: Ternary Relationship cardinality Archived from groups: comp>databases>theory (more info?)
|
|
|
Hi,
I am working on an assignment which has 2 ternary relationship. I'm
can't figure out their cardinality.
Maybe I am going through one of those mental blocks...
Can someone give me some cardinality examples for N-ary relationships?
all the pics i found on google images don't include this..
My other option is to convert the 3-ary relationship into a weak
entity.. but I'll definitely loose marks on that
Is it ok to have N'ary Relationships which includes recursion? looks
kind of odd to me
eg [person](buyer) trades [item] with [person](seller)
Thanks,
Mike >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 2) Posted: Mon Sep 18, 2006 11:57 pm
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
sorry I meant recursive relationship .. eg. Person Marries Person
J M Davitt wrote:
> miklesw.DeleteThis@gmail.com wrote:
> > Hi,
> >
> > I am working on an assignment which has 2 ternary relationship. I'm
> > can't figure out their cardinality.
> >
> > Maybe I am going through one of those mental blocks...
> >
> > Can someone give me some cardinality examples for N-ary relationships?
> > all the pics i found on google images don't include this..
> >
> > My other option is to convert the 3-ary relationship into a weak
> > entity.. but I'll definitely loose marks on that
> >
> > Is it ok to have N'ary Relationships which includes recursion? looks
> > kind of odd to me
> > eg [person](buyer) trades [item] with [person](seller)
>
> Recursion? How so? >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Jun 29, 2006 Posts: 52
|
(Msg. 3) Posted: Tue Sep 19, 2006 12:00 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
miklesw.TakeThisOut@gmail.com wrote:
> Hi,
>
> I am working on an assignment which has 2 ternary relationship. I'm
> can't figure out their cardinality.
>
> Maybe I am going through one of those mental blocks...
>
> Can someone give me some cardinality examples for N-ary relationships?
> all the pics i found on google images don't include this..
>
> My other option is to convert the 3-ary relationship into a weak
> entity.. but I'll definitely loose marks on that
>
> Is it ok to have N'ary Relationships which includes recursion? looks
> kind of odd to me
> eg [person](buyer) trades [item] with [person](seller)
Recursion? How so? >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 4) Posted: Tue Sep 19, 2006 1:03 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I know what cardinality is... and I know how to implement it
My problem is with the notation for a particular Ternary relationship.
(Supertype) [Parent]------[0..*]----- <Breeding>
----[1..1]--------[Child](subtype)
|-------------[0..*]------------|
The prob is when I use the N:1 notation..my first reaction would be to
do something like this:
(Supertype) [Parent]------1-----
<Breeding>-----M-------[Child](subtype)
|-------------1------------|
However that doesn't make sense since ParentA can be related to Many
ParentB's and viceversa. (don't think of the normal parent-child
scenario.. it's a game and the relationship is the actual act of
breeding)
PS I'm using Chen notation
PS2. After a day at work followed by 2 hours of transaction schedules
... I really couldn't give a damn about spelling&grammar..
Jonathan Leffler wrote:
> miklesw.RemoveThis@gmail.com wrote:
> > I am working on an assignment which has 2 ternary relationship. I'm
> > can't figure out their cardinality.
> >
> > Maybe I am going through one of those mental blocks...
> >
> > Can someone give me some cardinality examples for N-ary relationships?
> > all the pics i found on google images don't include this..
>
> Cardinality = number of { rows, records, tuples } in a relation.
>
> Count the number of 'rows' in the table - that's the cardinality.
>
> Degree = number of { fields, columns, attributes }.
>
> Ternary relations have degree 3 (or 'are of degree 3').
>
> > My other option is to convert the 3-ary relationship into a weak
> > entity.. but I'll definitely loose marks on that
>
> You may also lose marks for misspelling 'lose' (and not using plurals,
> and using "I'm can't" for "I can't", etc).
>
> > [...]
>
> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleffler.RemoveThis@earthlink.net, jleffler.RemoveThis@us.ibm.com
> Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Sep 05, 2006 Posts: 55
|
(Msg. 5) Posted: Tue Sep 19, 2006 1:41 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
miklesw.TakeThisOut@gmail.com wrote:
> I know what cardinality is... and I know how to implement it
>
> My problem is with the notation for a particular Ternary relationship.
>
> (Supertype) [Parent]------[0..*]----- <Breeding>
> ----[1..1]--------[Child](subtype)
> |-------------[0..*]------------|
Your ASCII art is a bit unclear so let me tell you how I interpret
this:
- You have a relationship Breeding(Parent1, Parent2, Child)
Your depicted cardinality constraints are as follows:
- Each Child participates in exactly one instance of that relationship.
- Each Parent participates in zero or more instances of that
relationship.
Minor detail: if *every* child has two parents your database will
either be infinite or some will be their own descendants.
> The prob is when I use the N:1 notation..my first reaction would be to
> do something like this:
>
> (Supertype) [Parent]------1-----
> <Breeding>-----M-------[Child](subtype)
> |-------------1------------|
The general rule is as follows: If you have a relationship R(a,b,c)
then you have to ask for each role, say 'a', how its cardinality
depends on the combination of the other two, in this case 'b' and 'c'.
If the upperbound is 1 then you put 1 on the corresponding edge in the
diagram, if there is no upperbound you put N or M there.
So let's look at Child. Given two particular parents what is the upper
bound on the number of children. There is no upperbound so the edge
Breeding--Child is annotated with N. Let's look at Parent1. Given
Parent2 and a child is there un upper bound on the number of associted
Parent1's? Yes, there can be at most one, (in fact, this is already the
case just for Child) so we annotate the edge Breeding--Parent(1) with
1.
Clear?
-- Jan Hidders >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 6) Posted: Tue Sep 19, 2006 2:42 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hi Jan,
> The general rule is as follows: If you have a relationship R(a,b,c)
> then you have to ask for each role, say 'a', how its cardinality
> depends on the combination of the other two, in this case 'b' and 'c'.
> If the upperbound is 1 then you put 1 on the corresponding edge in the
> diagram, if there is no upperbound you put N or M there.
Thanks for the insight...
> Minor detail: if *every* child has two parents your database will
> either be infinite or some will be their own descendants.
Care to expand on this? Note that parents can come into existence by
purchase, however since Children are a specialization of 'parent', they
can also breed.
Thanks,
Mike
Jan Hidders wrote:
> miklesw.RemoveThis@gmail.com wrote:
> > I know what cardinality is... and I know how to implement it
> >
> > My problem is with the notation for a particular Ternary relationship.
> >
> > (Supertype) [Parent]------[0..*]----- <Breeding>
> > ----[1..1]--------[Child](subtype)
> > |-------------[0..*]------------|
>
> Your ASCII art is a bit unclear so let me tell you how I interpret
> this:
> - You have a relationship Breeding(Parent1, Parent2, Child)
> Your depicted cardinality constraints are as follows:
> - Each Child participates in exactly one instance of that relationship.
>
> - Each Parent participates in zero or more instances of that
> relationship.
>
> Minor detail: if *every* child has two parents your database will
> either be infinite or some will be their own descendants.
>
> > The prob is when I use the N:1 notation..my first reaction would be to
> > do something like this:
> >
> > (Supertype) [Parent]------1-----
> > <Breeding>-----M-------[Child](subtype)
> > |-------------1------------|
>
> The general rule is as follows: If you have a relationship R(a,b,c)
> then you have to ask for each role, say 'a', how its cardinality
> depends on the combination of the other two, in this case 'b' and 'c'.
> If the upperbound is 1 then you put 1 on the corresponding edge in the
> diagram, if there is no upperbound you put N or M there.
>
> So let's look at Child. Given two particular parents what is the upper
> bound on the number of children. There is no upperbound so the edge
> Breeding--Child is annotated with N. Let's look at Parent1. Given
> Parent2 and a child is there un upper bound on the number of associted
> Parent1's? Yes, there can be at most one, (in fact, this is already the
> case just for Child) so we annotate the edge Breeding--Parent(1) with
> 1.
>
> Clear?
>
> -- Jan Hidders >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Sep 05, 2006 Posts: 55
|
(Msg. 7) Posted: Tue Sep 19, 2006 2:54 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
miklesw.DeleteThis@gmail.com wrote:
> Hi Jan,
>
> > The general rule is as follows: If you have a relationship R(a,b,c)
> > then you have to ask for each role, say 'a', how its cardinality
> > depends on the combination of the other two, in this case 'b' and 'c'.
> > If the upperbound is 1 then you put 1 on the corresponding edge in the
> > diagram, if there is no upperbound you put N or M there.
>
> Thanks for the insight...
>
> > Minor detail: if *every* child has two parents your database will
> > either be infinite or some will be their own descendants.
>
> Care to expand on this? Note that parents can come into existence by
> purchase, however since Children are a specialization of 'parent', they
> can also breed.
Ah, wait, now I understand your sub/superclass annotation. You say that
Child is a subclass of Parent (btw. letting both be a subclass of Dog
or whatever might be more logical) and a dog is in the class Child iff
it has parents.In that case there is no problem.
-- Jan Hidders >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 8) Posted: Tue Sep 19, 2006 3:22 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> Ah, wait, now I understand your sub/superclass annotation. You say that
> Child is a subclass of Parent (btw. letting both be a subclass of Dog
> or whatever might be more logical) and a dog is in the class Child iff
> it has parents.In that case there is no problem.
I don't think I can generalize both in 1 class... the actual heirarchy
is abit more complex than the parent/child example.
Person
IS A
CoolerPerson(who can take part in breeding)
IS A
ChildPerson OR EvenCoolerPerson
Not using the actual names as they got us all paranoid about this
anti-plagiarism WebBot..which probably doesn't exist..
Thanks Again,
Mike >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Sep 05, 2006 Posts: 55
|
(Msg. 9) Posted: Tue Sep 19, 2006 4:47 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
miklesw.TakeThisOut@gmail.com wrote:
> > Ah, wait, now I understand your sub/superclass annotation. You say that
> > Child is a subclass of Parent (btw. letting both be a subclass of Dog
> > or whatever might be more logical) and a dog is in the class Child iff
> > it has parents.In that case there is no problem.
>
> I don't think I can generalize both in 1 class... the actual heirarchy
> is abit more complex than the parent/child example.
>
> Person
> IS A
> CoolerPerson(who can take part in breeding)
> IS A
> ChildPerson OR EvenCoolerPerson
It depends a bit on which ER dialect you happen to be using. Strictly
speaking, if you specify that A IS-A C and B IS-A C this only means
that every A is a C, and every B is a C. So it does not mean that A and
B are disjoint (i.e., there can be entities in both A and B) or that
every C is either an A or a B. Usually there are special combined
isa-edges to denote the latter two constraints. But, again, this may
depend on the dialect your instructor / professor is using, so be sure
to check the IS-A semantics in the notation you have to use.
-- Jan Hidders >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Oct 04, 2006 Posts: 14
|
(Msg. 10) Posted: Tue Sep 19, 2006 5:00 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> It depends a bit on which ER dialect you happen to be using. Strictly
> speaking, if you specify that A IS-A C and B IS-A C this only means
> that every A is a C, and every B is a C. So it does not mean that A and
> B are disjoint (i.e., there can be entities in both A and B) or that
> every C is either an A or a B. Usually there are special combined
> isa-edges to denote the latter two constraints. But, again, this may
> depend on the dialect your instructor / professor is using, so be sure
> to check the IS-A semantics in the notation you have to use.
Thanks for the tip.. According to this presentation I got from the net,
IS-A's can be partial or total (in my case they're partial).. will add
a note in the ER stating all entities in hierarchy are Concrete classes
just in case..
Mike >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
External

Since: Jul 11, 2003 Posts: 304
|
(Msg. 11) Posted: Tue Sep 19, 2006 7:10 am
Post subject: Re: Ternary Relationship cardinality [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
miklesw RemoveThis @gmail.com wrote:
> I am working on an assignment which has 2 ternary relationship. I'm
> can't figure out their cardinality.
>
> Maybe I am going through one of those mental blocks...
>
> Can someone give me some cardinality examples for N-ary relationships?
> all the pics i found on google images don't include this..
Cardinality = number of { rows, records, tuples } in a relation.
Count the number of 'rows' in the table - that's the cardinality.
Degree = number of { fields, columns, attributes }.
Ternary relations have degree 3 (or 'are of degree 3').
> My other option is to convert the 3-ary relationship into a weak
> entity.. but I'll definitely loose marks on that
You may also lose marks for misspelling 'lose' (and not using plurals,
and using "I'm can't" for "I can't", etc).
> [...]
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler RemoveThis @earthlink.net, jleffler RemoveThis @us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ >> Stay informed about: Ternary Relationship cardinality |
|
| Back to top |
|
 |  |
| Related Topics: | I think my book may be wrong about cardinality, but I'm no.. - hello 1) The following quote ( well I shortened it a bit ) is from a chapter briefly describing MARTIN E-R notation "Say we have entities ORDER and PRODUCT. One ORDER must include at least one product, but it can also have more than one product. ...
Transforming 1-1-M Ternary Relationships into Logical - Most text books state that Ternary relationships are implemented as a table with FKs for all the relations.. i was wondering how are 1-1-M relationships implemented.. It seems pointless to me... In 1-M binary relationships.. the FK is placed on the M..
Cardinality of relation with empty set of attributes is 1 - Proof: MVFD with empty antecedent, for example {} -> {X} | {Y,Z} claims that cardinality of the XYZ relation is the product of cardinalities of its projection onto the sets X and YZ of attributes. Take {X} to be an empty set, then: {} -> {} | {X...
Generating binary and ternary trees in teh neste4d sets mo.. - Bear with me and the set up for the problem. There are many ways to represent a tree or hierarchy in SQL. This is called an adjacency list model and it looks like this: CREATE TABLE OrgChart (emp_id CHAR(10) NOT NULL PRIMARY KEY, boss_emp_id CHAR(10)...
Relationship Problem - Hello, I have a database for employee's time sheet (to record daily in out time). I created employee master/parent table with Fields(Emp_ID, Name, Dept_ID). Due to some company policy I have to assign three different designation to each employee,.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|