From e19e1389ba77f49f333932ed9eb09689a871ee35 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 16 Jul 2020 16:31:43 -0400 Subject: [PATCH] actualizar schema --- schema.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/schema.sql b/schema.sql index 4980f28..64a6e47 100644 --- a/schema.sql +++ b/schema.sql @@ -139,3 +139,19 @@ CREATE TABLE PARTICIPAR_PRECOMPETENCIA( CONSTRAINT PARTICIPAR_PRECOMPETENCIA_PRECOMPETENCIA_FK FOREIGN KEY (ID_PRECOMPETENCIA) REFERENCES PRECOMPETENCIA(ID_PRECOMPETENCIA), CONSTRAINT PARTICIPAR_PRECOMPETENCIA_ATLETA_FK FOREIGN KEY (ID_ATLETA) REFERENCES ATLETA(ID_ATLETA) ); + +CREATE TABLE PERTENECER( + ID_DELEGACION NUMBER, + ID_PAIS NUMBER, + CONSTRAINT PERTENECER_PK PRIMARY KEY (ID_DELEGACION, ID_PAIS), + CONSTRAINT PERTENECER_DELEGACION_FK FOREIGN KEY (ID_DELEGACION) REFERENCES DELEGACION(ID_DELEGACION), + CONSTRAINT PERTENECER_PAIS_FK FOREIGN KEY (ID_PAIS) REFERENCES PAIS(ID_PAIS) +); + +CREATE TABLE COMPETER_POR( + ID_ATLETA NUMBER, + ID_DELEGACION NUMBER, + CONSTRAINT COMPETER_POR_PK PRIMARY KEY (ID_ATLETA, ID_DELEGACION), + CONSTRAINT COMPETER_POR_ATLETA_FK FOREIGN KEY (ID_ATLETA) REFERENCES ATLETA(ID_ATLETA), + CONSTRAINT COMPETER_POR_DELEGACION_FK FOREIGN KEY (ID_DELEGACION) REFERENCES DELEGACION(ID_DELEGACION) +);