DEV_BUT1/DEV2.1/tp4.txt
2023-04-04 14:03:16 +02:00

21 lines
1.4 KiB
Plaintext
Executable File

insert into AEROPORT values('LFPG','CDG', 'PARIS', 'FRANCE');
insert into AEROPORT values('LFPG','crocs', 'PARIS', 'FRANCE');
insert into AEROPORT values('LFPO','ORLY', 'PARIS', 'FRANCE');
insert into AEROPORT values('LFML','MRS', 'MARSEILLE', 'FRANCE');
insert into AEROPORT values(null,'UI', 'MARSEILLE', 'FRANCE');
ORA-00001: violation de contrainte unique (MELIANI.SYS_C0083286)
ORA-01400: impossible d'insérer NULL dans ("MELIANI"."AEROPORT"."CODEAEROPORT")
Exo2
Create table ESCALE(numVol int, numEscale int, aeroportDepart varchar(15) references Aeroport,
aeroportArrivee varchar(15) references Aeroport, heureDepartPrevue int, minuteDepartPrevue int, heureArriveePrevue int, minuteArriveePrevue int, primary key(numVol, numEscale));
CREATE TABLE INSTANCE_ESCALE(numVol int, numEscale int, dateEscale date, nbreSieges int, idAvion int references Avion, dateDepartEffectue date, dateArriveeEffectue date,idEquipe int,
primary key(numVol, numEscale, dateEscale), foreign key(numVol, numEscale)references ESCALE);
ALTER TABLE INSTANCE_ESCALE ADD FOREIGN KEY(idEquipe) REFERENCES Equipage;
CREATE TABLE Equipage(numVol int, numEscale int, dateEscale date, idEquipe int primary key, idPilote int, idCoPilote int, idChefCabine int, foreign key(numVol,numEscale,dateEscale) references INSTANCE_ESCALE);
CREATE TABLE HOTESSE_EQUIPAGE(idEquipe int references Equipage references Personnel, idPersonne int, primary key(idEquipe,idPersonne));