crear consulta 1

This commit is contained in:
Chris Cromer 2020-06-20 16:02:35 -04:00
parent e0e021ff22
commit 93ecb23bc3
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A

12
consulta.sql Normal file
View File

@ -0,0 +1,12 @@
-- Consulta 1 de la guia
SELECT CONCAT(A.NOMBRE, CONCAT(' ', A.APELLIDO)) AS NOMBRE_ATLETA
FROM PARTICIPAR_PRECOMPETENCIA PP
LEFT JOIN ATLETA A ON (PP.ID_ATLETA = A.ID_ATLETA)
WHERE A.ID_ATLETA NOT IN (
SELECT PC.ID_ATLETA
FROM PARTICIPAR_COMPETENCIA PC
LEFT JOIN COMPETENCIA C ON (C.ID_COMPETENCIA = PC.ID_COMPETENCIA)
LEFT JOIN PRECOMPETENCIA P ON (P.COMPETENCIA = C.ID_COMPETENCIA)
LEFT JOIN PARTICIPAR_PRECOMPETENCIA PP2 ON (PP2.ID_PRECOMPETENCIA = P.ID_PRECOMPETENCIA)
WHERE (PC.ID_ATLETA = PP2.ID_ATLETA)
);