Re: circular relationships ok?

From: Brian Selzer <brian_at_selzer-software.com>
Date: Mon, 06 Mar 2006 03:58:31 GMT
Message-ID: <HrOOf.18957$rL5.7700_at_newssvr27.news.prodigy.net>


You're right. I hadn't considered the short tails at the end. I had erroneously discarded the notion that a spiral relationship could exist because the functional dependencies can no longer be functional dependencies if the determinant implies one value directly and a different value transitively. In order for the relationship to be circular and not spiral, both attributes in each relation that participates in the foreign key constraints must also be candidate keys.

Thank you for pointing that out.

"Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message news:gGAOf.296091$IR1.9311296_at_phobos.telenet-ops.be...
> Brian Selzer wrote:
>>
>> In other words, a database schema consisting of the relation schemata,
>>
>> R{A, B}, S{B, C}, and T{C, A}
>>
>> and the foreign key constraints,
>>
>> R(B) --> S(B), S(C) --> T(C), T(A) --> R(A)
>>
>> is equivalent to a database schema consisting of the same relation
>> schemata
>> and the foreign key constraints,
>>
>> R(A) --> T(A), T(C) --> S(C), S(B) --> R(B)
>>
>> is equivalent to a database schema consisting of the relation schema
>>
>> U(A, B, C) where A, B, and C are candidate keys.
>
> Actually, none of them are equivalent. Consider the following database
> instances: (formatted assuming fixed width font)
>
> R : A B S : B C T : C A
> --- --- ---
> 1 2 2 3 3 1
> 4 3
>
> This is an instance of the first schema, but not of the second. A
> similar example shows thre is an instance of the second schema that is
> not an instance of the first schema:
>
> R : A B S : B C T : C A
> --- --- ---
> 1 3 3 2 2 1
> 3 4
>
> Finally, it is clear that these two instances cannot be represented in
> the third schema since the join would lose tuples. So they are really
> all three different.
>
> What *is* true is that the following schema:
>
> - R(A,B), with cand. keys {A} and {B}
> - S(B,C), with cand. keys {B} and {C}
> - T(C,A), with cand. keys {C} and {A}
> - foreign keys:
> R[B] -> S[B], S[B] -> R[B],
> S[C] -> T[C], T[C] -> S[C],
> T[A] -> R[A], R[A] -> T[A]
>
> Is equivalent with the schema:
>
> - U(A,B,C) with cand. keys {A}, {B} and {C}
>
> So perhaps that is what you meant?
>
> -- Jan Hidders
Received on Mon Mar 06 2006 - 04:58:31 CET

Original text of this message