Considere as seguintes consultas envolvendo dados de duas tabelas (T1 e T2) que possuem o atributo CODIGO em comum e assinale a opção correta.
Consulta 1,
SELECT * FROM T1
WHERE CODIGO IN (SELECT CODIGO FROM T2)
Consulta 2
SELECT * FROM T1 WHERE NOT
EXISTS (SELECT CODIGO FROM T2 WHERE
T1.CODIGO = T2.CODIGO )
Consulta 3
SELECT T1.*, T2.*
FROM T1 INNER JOIN T2
ON T1.CODIGO = T2.CODIGO
Consulta 4
SELECT *
FROM T1 WHERE CODIGO NOT IN (SELECT CODIGO FROM T2)
Consulta 5
SELECT T1.*
FROM T1 LEFT OUTER JOIN T2
ON T1.CODIGO = T2.CODIGO
WHERE T2.CODIGO IS NULL
Consulta 6
SELECT T1.*, T2.*
FROM T1, T2
WHERE T1.CODIGO = T2.CODIGO
Consulta 1,
SELECT * FROM T1
WHERE CODIGO IN (SELECT CODIGO FROM T2)
Consulta 2
SELECT * FROM T1 WHERE NOT
EXISTS (SELECT CODIGO FROM T2 WHERE
T1.CODIGO = T2.CODIGO )
Consulta 3
SELECT T1.*, T2.*
FROM T1 INNER JOIN T2
ON T1.CODIGO = T2.CODIGO
Consulta 4
SELECT *
FROM T1 WHERE CODIGO NOT IN (SELECT CODIGO FROM T2)
Consulta 5
SELECT T1.*
FROM T1 LEFT OUTER JOIN T2
ON T1.CODIGO = T2.CODIGO
WHERE T2.CODIGO IS NULL
Consulta 6
SELECT T1.*, T2.*
FROM T1, T2
WHERE T1.CODIGO = T2.CODIGO