-- ============================================================ -- Nom de la base : MODELE_1 -- Nom de SGBD : ORACLE Version 7.0 -- Date de création : 05/05/2006 09:09 -- ============================================================ -- ============================================================ -- Table : CLIENT -- ============================================================ create table CLIENT ( CodeClient NUMBER(6) not null, NomClient CHAR(30) not null, PrenomClient CHAR(30) not null, NumeroRueClient CHAR(4) not null, RueClient CHAR(30) not null, BPClient CHAR(5) null , CodePostalClient CHAR(6) not null, VilleClient CHAR(30) not null, PaysClient CHAR(20) not null ) / -- ============================================================ -- Index : CLIENT_PK -- ============================================================ create unique index CLIENT_PK on CLIENT (CodeClient asc) / -- ============================================================ -- Table : CATEGORIE -- ============================================================ create table CATEGORIE ( CodeCategorie CHAR(4) not null, LibelleCategorie CHAR(30) not null ) / -- ============================================================ -- Index : CATEGORIE_PK -- ============================================================ create unique index CATEGORIE_PK on CATEGORIE (CodeCategorie asc) / -- ============================================================ -- Table : GRILLE_TARIFAIRE -- ============================================================ create table GRILLE_TARIFAIRE ( CodeTarif CHAR(5) not null, DemiJour NUMBER(6) not null, Jour NUMBER(6) not null, DeuxJours NUMBER(6) not null, TroisJours NUMBER(6) not null, QuatreJours NUMBER(6) not null, CinqJours NUMBER(6) not null, SupplemJour NUMBER(6) not null, DateDebutValid DATE not null, DateFinValid DATE null ) / -- ============================================================ -- Index : GRILLE_TARIFAIRE_PK -- ============================================================ create unique index GRILLE_TARIFAIRE_PK on GRILLE_TARIFAIRE (CodeTarif asc) / -- ============================================================ -- Table : CONSOMMABLE -- ============================================================ create table CONSOMMABLE ( CodeConsommable CHAR(6) not null, LibelleConsommable CHAR(20) not null, TarifConsommable NUMBER(6) not null ) / -- ============================================================ -- Index : CONSOMMABLE_PK -- ============================================================ create unique index CONSOMMABLE_PK on CONSOMMABLE (CodeConsommable asc) / -- ============================================================ -- Table : PARTICULARITE -- ============================================================ create table PARTICULARITE ( CodeParticularite CHAR(6) not null, LibelleParticularite CHAR(30) not null ) / -- ============================================================ -- Index : PARTICULARITE_PK -- ============================================================ create unique index PARTICULARITE_PK on PARTICULARITE (CodeParticularite asc) / -- ============================================================ -- Table : OUTIL -- ============================================================ create table OUTIL ( CodeOutil CHAR(20) not null, CodeCategorie CHAR(4) not null, NomOutil CHAR(20) not null, PrixNeufOutil NUMBER(6) not null, CautionOutil NUMBER(6) not null ) / -- ============================================================ -- Index : OUTIL_PK -- ============================================================ create unique index OUTIL_PK on OUTIL (CodeOutil asc) / -- ============================================================ -- Index : appartient_a_FK -- ============================================================ create index appartient_a_FK on OUTIL (CodeCategorie asc) / -- ============================================================ -- Table : a_pour_option -- ============================================================ create table a_pour_option ( CodeOutil CHAR(20) not null, OUT_CodeOutil CHAR(20) not null ) / -- ============================================================ -- Index : a_pour_option_PK -- ============================================================ create unique index a_pour_option_PK on a_pour_option (CodeOutil asc, OUT_CodeOutil asc) / -- ============================================================ -- Table : a_pour_tarif -- ============================================================ create table a_pour_tarif ( CodeOutil CHAR(20) not null, CodeTarif CHAR(5) not null ) / -- ============================================================ -- Index : a_pour_tarif_PK -- ============================================================ create unique index a_pour_tarif_PK on a_pour_tarif (CodeOutil asc, CodeTarif asc) / -- ============================================================ -- Table : necessite -- ============================================================ create table necessite ( CodeOutil CHAR(20) not null, CodeConsommable CHAR(6) not null ) / -- ============================================================ -- Index : necessite_PK -- ============================================================ create unique index necessite_PK on necessite (CodeOutil asc, CodeConsommable asc) / -- ============================================================ -- Table : a_pour_particularite -- ============================================================ create table a_pour_particularite ( CodeOutil CHAR(20) not null, CodeParticularite CHAR(6) not null ) / -- ============================================================ -- Index : a_pour_particularite_PK -- ============================================================ create unique index a_pour_particularite_PK on a_pour_particularite (CodeOutil asc, CodeParticularite asc) / -- ============================================================ -- Table : a_loue -- ============================================================ create table a_loue ( CodeClient NUMBER(6) not null, CodeOutil CHAR(20) not null, CodeConsommable CHAR(6) not null, CON_CodeConsommable CHAR(6) not null, DateDebutLocation DATE not null, DateFinLocation DATE not null, QuantiteConsommable NUMBER(6) null ) / -- ============================================================ -- Index : a_loue_PK -- ============================================================ create unique index a_loue_PK on a_loue (CodeClient asc, CodeOutil asc, CodeConsommable asc, CON_CodeConsommable asc) / alter table OUTIL add constraint fk_appartient_a foreign key (CodeCategorie) references CATEGORIE (CodeCategorie) / alter table a_pour_option add constraint fk_LIEN_46 foreign key (CodeOutil) references OUTIL (CodeOutil) / alter table a_pour_option add constraint fk_LIEN_47 foreign key (OUT_CodeOutil) references OUTIL (CodeOutil) / alter table a_pour_tarif add constraint fk_LIEN_70 foreign key (CodeOutil) references OUTIL (CodeOutil) / alter table a_pour_tarif add constraint fk_LIEN_71 foreign key (CodeTarif) references GRILLE_TARIFAIRE (CodeTarif) / alter table necessite add constraint fk_LIEN_80 foreign key (CodeOutil) references OUTIL (CodeOutil) / alter table necessite add constraint fk_LIEN_81 foreign key (CodeConsommable) references CONSOMMABLE (CodeConsommable) / alter table a_pour_particularite add constraint fk_LIEN_88 foreign key (CodeOutil) references OUTIL (CodeOutil) / alter table a_pour_particularite add constraint fk_LIEN_89 foreign key (CodeParticularite) references PARTICULARITE (CodeParticularite) / alter table a_loue add constraint fk_LIEN_100 foreign key (CodeClient) references CLIENT (CodeClient) / alter table a_loue add constraint fk_LIEN_101 foreign key (CodeOutil) references OUTIL (CodeOutil) / alter table a_loue add constraint fk_LIEN_102 foreign key (CodeConsommable) references CONSOMMABLE (CodeConsommable) / alter table a_loue add constraint fk_LIEN_108 foreign key (CON_CodeConsommable) references CONSOMMABLE (CodeConsommable) /