> > It appears to be a join of> select sno, count(*) as np from sp group by sno> with> select sno from s> on sno>

Yes that is exactly what i have thought.

> What RESTRICT ? I see WHERE in the scope of EXTEND in there.

Yes EXTEND is a keyword here, you have given me right direction, thank you.

EXTEND A ADD exp AS Z is a relation with:
...
A body consisting of all tuples t such that t is a tuple of A extended with
a value for attribute Z that is computed by *evaluating* exp on *that*
tuple of A.