| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: a sort-of key question
paul c wrote:
> Looking at Darwen and Date's Third Manifesto, chapter four and
> re-examining the fundamental operations that seem possible within the
> relational model (to the extent that there is any common agreement about
> what that is) I wonder how to answer the following question:
>
> What are the last names of the people who share a last name with
> somebody else?
>
> Suppose the relation R is this:
>
> LAST FIRST
> _____ _____
> Smith Billy
> Smith Bobby
> Jones Nathan
>
> I'd expect the answer to be {Smith}.
Let the relation be R(Last,First)
S := RENAME[First->First2](R) T := R JOIN S // JOIN = the natural join U := SELECT[First<>First2](T) V := PROJECT[Last](U)
![]() |
![]() |