sábado, 1 de marzo de 2008

Obtener los códigos de los proyectos a los cuales se vendan por lo menos todas las partes suministradas por el proveedor S1.

Select Distinct J#
from SPJ, SPJX
where not exists (select P#
from SPJ SPJY
where SPJY.S# = ‘s1’#
and not exists (select *
from SPJ SPJZ
where SPJZ.P# = SPJY.P#
and SPJ.J# = SPJX.J#));

Algegra: SPJ [J#, P#] divideby (spj where S# = ‘S1’) [P#]

No hay comentarios: