Re: Tutorial D with + restrict
Date: Thu, 30 Mar 2006 12:31:00 +0300
Message-ID: <e0g8gh$54k$1_at_emma.aioe.org>
"Strider" <Anymore_at_shore.it> wrote in message
news:Xns97965FC11EAB4strider5athome_at_195.34.135.101...
> Hi there,
>
> I am reading Date's Databases in Depth now, and having trouble with
> expressions like this (it shoud return supp. numbers with numbers of
> distinct parts each suppliers supplies):
I have not read that book.
> WITH ( SP RENAME ( SNO AS X ) ) AS R :
select sno, count(*) as np from sp group by sno
with
select sno from s
> EXTEND ( S { SNO } ) ADD ( COUNT ( R WHERE X = SNO ) AS NP )
It appears to be a join of
on sno
> what troubles me is thist inner "R WHERE X = SNO" part
> It puzzles me how can R "know" value of SNO attribute?
> Is it just repeatedly evalueated for each tuple of S{SNO}?
> Seems so, but this scenario is not covered in the explanation of RESTRICT
> operator.
What RESTRICT ? I see WHERE in the scope of EXTEND in there. Received on Thu Mar 30 2006 - 11:31:00 CEST