· 8 years ago · Jan 30, 2018, 08:12 AM
1Drop database if exists creatBdConge;
2
3-- Création de la table Service
4
5Create table Service(
6NumService INT(4),
7Libelle VARCHAR2(30) NOT NULL,
8Hierarchie INT(4),
9Constraint pk_NumService primary key (Service),
10Constraint fk_Hierarchie Foreign key (Hierarchie) REFERENCES Service(NumService)
11);
12
13Create table NatureConge(
14NumNatureConge INT(2),
15LibelleNat VARCHAR2(30)
16Constraint pk_NumNatureConge primary key (NatureConge)
17);
18
19Create table Employe(
20NumEmploye INT(2),
21Nom VARCHAR2(30),
22Prenom VARCHAR2(30),
23Telephone INT(10),
24NumService INT(4)
25Constraint pk_NumEmploye primary key (Employe),
26Constraint fk_NumService Foreign key (NumService) REFERENCES Service(NumService)
27);
28
29Create table DroitConge(
30NumEmploye INT(2),
31NumNatureConge INT(2),
32Nbjours INT(4),
33Constraint pk_NumEmploye_NumNatureConge primary key (NumEmploye,NumNatureConge),
34Constraint fk_NumEmploye Foreign key (NumEmploye) REFERENCES Employe(NumEmploye),
35Constraint fk_NumNatureConge Foreign key (NumNatureConge) REFERENCES NatureConge(NumNatureConge)
36);