INF1250 TP2
Create database jegere ;
Résultat : Query OK, 1 row affected (0,00 sec)
Utilisation de la base jegere
Use jegere
Création de la table Client
Create table if not exists jegere.Client ( idClient INT Not null,
NomClient VARCHAR(45) NOT NULL,
Adresse VARCHAR(45) NOT NULL,
Telephone VARCHAR(45) NOT NULL,
AdresseCourriel VARCHAR(45) NOT NULL,
NomPays VARCHAR(7) NOT NULL,
Primary Key (idClient));
Résultat: Query OK, 0 rows affected (0.02 sec)
Création de la table Étape
Create table if not exists jegere.etape ( idEtape INT NOT NULL,
NomEtape VARCHAR(45) NOT NULL,
Livrable VARCHAR(45) NOT NULL,
Primary Key (idEtape));
Résultat: Query OK, 0 rows affected (0.00 sec)
Création de la table Employé
CREATE TABLE IF NOT EXISTS jegere.Employe( idEmploye INT NOT NULL, nomEmploye VARCHAR(45) NOT NULL, adresse VARCHAR(45) NOT NULL, telephone VARCHAR(45) NOT NULL, adresseCourriel VARCHAR(45) NOT NULL,
PRIMARY KEY (idEmploye));
Résultat: Query OK, 0 rows affected (0.42 sec)
Création de la table Projet
Create table if not exists jegere.projet ( idProjet INT NOT NULL, idClient INT NOT NULL,
NomProjet VARCHAR(45) NOT NULL, dateDebut DATE NOT NULL,
DateFin DATE, idResponsable INT NOT NULL,
Primary Key (idProjet),
Foreign Key (idResponsable) references jegere.employe (idEmploye),
Foreign key (idClient) references jegere.Client (idClient),
Check (idProjet between 0 and 4000));
Résultat: Query OK, 0 rows affected (0.43 sec)
Création de la table RessourcesProjet
CREATE TABLE IF NOT EXISTS jegere.RessourcesProjet( idProjet INT NOT NULL, idEmploye INT NOT NULL, nbrHeures INT NOT NULL, prixHeures FLOAT NOT NULL,
FOREIGN KEY (idProjet) REFERENCES jegere.Projet (idProjet),
FOREIGN KEY(idEmploye) REFERENCES jegere.Employe (idEmploye));
Résultat: Query OK, 0 Rows affected (0.01 sec)
Création de la table EtapexProjet
Create table if not exists jegere.EtapexProjet ( idEtape INT NOT NULL, idProjet INT NOT NULL,
DateDebut DATE NOT NULL,