Re: Perhaps an idiotic question

From: Neo <neo55592_at_hotmail.com>
Date: 29 Nov 2006 17:26:55 -0800
Message-ID: <1164850015.274942.137240_at_j72g2000cwa.googlegroups.com>


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

If you meant that records in tableR have an attribute whose type is R, then it might look like this in dbd:

(new 't1 'R)
(new 't2 'R)
(new 'A 'R)

(new 't4)
(new 't5)

(set t1 A t4)

(set t2 A t4)
(set t2 A t5)

If you meant that records in tableR have an attribute whose value(s) are of type R, then it might look like this in dbd:

(new 't1 'R)
(new 't2 'R)
(new 't3 'R)

(new 'A)

(set t1 A t2)

(set t2 A t3)
(set t2 A t1)

(set t3 A t3)

If you meant that tableR itself has an attribute whose type is R, then it might look like this in dbd:

(new 't1 'R)
(new 'A 'R)
(new 't2)
(set R A t2)

Note: The new function creates a thing named by first string and classified by remaining strings. The set function creates a sequence with specified elements which must already exist in db. Received on Thu Nov 30 2006 - 02:26:55 CET

Original text of this message