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) +);