Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2009, 06:13
Avatar de abmptc
abmptc
 
Fecha de Ingreso: septiembre-2009
Mensajes: 43
Antigüedad: 14 años, 7 meses
Puntos: 0
Duda con CUATRO Select (no veo la diferencia entre ellas)

Hola tengo una duda en el siguiente test. Dan como buena la respuesta b) y seguro que esta bien, pero no consigo ver la diferencia entre estas cuatro Select.

¿Cual de las siguientes sentencias SQL obtendría el total de puestos vacantes actualmente, para los que no se exige titulación '010', por unidad y por nivel?

a)
select o.nuni, p.nivel, count(*)
from puesto p, titulaciones o
where p.ffin is null and p.npt =o.npt and o.titulacion <>'010'
and p.npt not in (select npt from actividad a where a.npt=p.npt and a.fces is null)
group by p.nuni, p.nivel

b)
select o.nuni, p.nivel, count(*)
from puesto p
where p.ffin is null and
and p.npt not in (select o.npt from titulaciones o where o.titualciones='010')
and p.npt not in (select npt from actividad a where a.npt=p.npt and a.fces is null)
group by p.nuni, p.nivel

c)
select o.nuni, p.nivel, count(*)
from puesto p, titulaciones o, actividad a
where p.ffin is null and p.npt =o.npt and o.titulacion <>'010'

group by p.nuni, p.nivel

d)
select o.nuni, p.nivel, count(*)
from puesto p, actividad a
where p.ffin is null and
p.npt not in (select o.npt from titulaciones o where o.titualciones='010')
and p.npt=a.npt and a.fces is not null
group by p.nuni, p.nivel


Un saludo.