Código:
Gracias y un saludo!! CREATE TABLE VUELOS ( numvue NUMERIC NOT NULL, fecvue DATE NOT NULL, horsalvue TIME NOT NULL, origvue VARCHAR NOT NULL, destvue VARCHAR NOT NULL, numpasvue NUMERIC NOT NULL, CONSTRAINT pk_vue PRIMARY KEY(numvue) ); CREATE TABLE TURISTAS ( dnitur VARCHAR NOT NULL, nomtur VARCHAR NOT NULL, apetur VARCHAR NOT NULL, dirtur VARCHAR NOT NULL, tlftur VARCHAR NOT NULL, fecnactur DATE NOT NULL, CONSTRAINT pk_tur PRIMARY KEY(dnitur) ); CREATE TABLE HOTELES ( nomhot VARCHAR NOT NULL, dirhot VARCHAR NOT NULL, tlfhot VARCHAR NOT NULL, ciuhot VARCHAR NOT NULL, CONSTRAINT pk_hot PRIMARY KEY(nomhot) ); CREATE TABLE TUR_TOMAR_VUE ( dnitur VARCHAR NOT NULL, numvue NUMERIC NOT NULL, clase VARCHAR NOT NULL, CONSTRAINT pk_turvue PRIMARY KEY(dnitur, numvue), CONSTRAINT fk_tur FOREIGN KEY(dnitur) REFERENCES TURISTAS(dnitur), CONSTRAINT fk_vue FOREIGN KEY(numvue) REFERENCES VUELOS(numvue) ); CREATE TABLE TUR_RESERVAR_HOT ( dnitur VARCHAR NOT NULL, nomhot VARCHAR NOT NULL, fechaentrada DATE NOT NULL, fechasalida DATE NOT NULL, tipopension VARCHAR NOT NULL, CONSTRAINT pk_turhot PRIMARY KEY(dnitur, nomhot), CONSTRAINT fk_tur FOREIGN KEY(dnitur) REFERENCES TURISTAS(dnitur), CONSTRAINT fk_hot FOREIGN KEY(nomhot) REFERENCES HOTELES(nomhot) );