Re: Perhaps an idiotic question

From: paul c <toledobythesea_at_oohay.ac>
Date: Fri, 01 Dec 2006 14:48:39 GMT
Message-ID: <bhXbh.402729$5R2.181802_at_pd7urf3no>


Bob Badour wrote:
> Gene Wirchenko wrote:
>

>> Bob Badour <bbadour_at_pei.sympatico.ca> wrote:
>>
>>
>>> Gene Wirchenko wrote:
>>>
>>>
>>>> Bob Badour <bbadour_at_pei.sympatico.ca> wrote:
>>>>
>>>>
>>>>> Gene Wirchenko wrote:
>>>>>
>>>>>
>>>>>> paul c <toledobythesea_at_oohay.ac> wrote:
>>>>>>
>>>>>>
>>>>>>> But it perplexes me even though I admit I have no good reason for 
>>>>>>> asking:
>>>>>>>
>>>>>>> If I declare a relation (or more properly a relvar) R to have an 
>>>>>>> attribute A where A's type is the type of R am I declaring a 
>>>>>>> fallacy or something that is logically possible (ignoring whether 
>>>>>>> it has any use)?
>>>>>>
>>>>>>
>>>>>>    I see recursion but no termination.
>>>>>>
>>>>>>    What *is* the use of such a declaration?
>>>>>
>>>>>
>>>>> What would be the type of a view that combines a recursion or 
>>>>> closure with the GROUP operation?
>>>>
>>>>
>>>>     I do not know since I see recursion but no termination.  If that
>>>> is the case, the type can not declared in the first place.
>>>
>>>
>>> Sure, it can. It just requires a forward reference.
>>
>>
>>
>>>>     I can see the attribute being an FK into its own relation.  The
>>>> type then is more pointer to R than R.  (That wording is not quite
>>>> right, but I hope the concept comes through.)
>>>
>>>
>>> Suppose you have a reference from R1 to R1. e.g. Employee relation 
>>> has a Manager reference to Employee. You declare a recursive view 
>>> that groups the manager references as a relation valued attribute.
>>>
>>> Whether the recusion terminates depends on what you did with the 
>>> CEO's manager reference and how you wrote the recursion.
>>
>>
>>      I do not see it.  Could you please post some p-code?

>
>
> Something like the following:
>
> EE = extend (Emp where mgr# = e#)
> add bosses as relation same heading as EE {}
> union
> extend (Emp where mgr# != e#)
> add bosses as (EE where EE.mgr# = mgr#)

I had been wondering about such relations (part of constantly wondering about transitive closure) but am not as good as others here at writiing them down. In a way my confusion goes all the way back to when Codd invented his "roles" aka attribute names. I wondered whether it might be useful to formulate a system where join or better still, a relational logical "and" could apply to any attributes of equal name even if they were recursively "buried".

I didn't want to say this before because first thing in the morning it sounds like mumbo-jumbo, but I feel your discussion is helping me clarify what, if any, thoughts I had.

p Received on Fri Dec 01 2006 - 15:48:39 CET

Original text of this message