informatique clé primaire
CREATE TABLE TRIATHLETE ( NumLicence int NOT NULL AUTO_INCREMENT, NomAthlete varchar (50) NOT NULL, PrenomAthlete varchar (50) NOT NULL, CategorieAthlete varchar (50) NULL, PRIMARY KEY (NumLicence) ) ;
CREATE TABLE PISCINE (
NumPiscine int NOT NULL AUTO_INCREMENT,
NomPiscine varchar (50) NOT NULL,
AdressePiscine varchar (100) NOT NULL,
PRIMARY KEY (NumPiscine) ) ;
CREATE ENTRAINEMENT (
NumEntrainement int NOT NULL AUTO_INCREMENT,
DateEntrainement date NULL,
HeureDebut heure NULL,
HeureFin heure NULL,
NumPiscine int NOT NULL,
PRIMARY KEY (NumEntrainement) ) ;
CREATE PLAN_ENTRAINEMENT (
NumEntrainement int NOT NULL,
NumLicence int NOT NULL,
DistanceAParcourir int NULL,
DistanceParcourue int NULL,
PRIMARY KEY (NumEntrainement, NumLicence) ) ;
ALTER TABLE ENTRAINEMENT ADD
FOREIGN KEY (NumPiscine) REFERENCES PISCINE (NumPiscine) ;
ALTER TABLE PLAN_ENTRAINEMENT ADD
FOREIGN KEY (NumEntrainement) REFERENCES ENTRAINEMENT (NumEntrainement),
FOREIGN KEY (NumLicence) REFERENCES TRIATHLETE (NumLicence) ;
2.2) SELECT DateEntrainement, HeureDebut, HeureFin, NomPiscine DistanceAParcourir, DistanceParcourue, NumLicence
FROM ENTRAINEMENT, PLAN_ENTRAINEMENT, PISCINE
WHERE ENTRAINEMENT.NumEntrainement = PLAN_ENTRAINEMENT.NumEntrainement
AND ENTRAINEMENT.NumPiscine = PISCINE.NumPiscine
AND PLAN_ENTRAINEMENT.NumLicence = 2413
AND DateEntrainement > "01/09/1999"
ORDER BY DESC DateEntrainement ;
2.3) SELECT NomAthlete, PrenomAthlete, DateEntrainement
FROM TRIATHLETE, ENTRAINEMENT, PLAN_ENTRAINEMENT, PISCINE
WHERE TRIATHLETE.NumLicence = PLAN_ENTRAINEMENT.NumLicence
AND ENTRAINEMENT.NumEntrainement =