site:enseignement:licence:2i009:donnees:tme8-creations-cascade-h2
Différences
Ci-dessous, les différences entre deux révisions de la page.
| site:enseignement:licence:2i009:donnees:tme8-creations-cascade-h2 [14/04/2020 09:35] – créée amine | site:enseignement:licence:2i009:donnees:tme8-creations-cascade-h2 [14/04/2020 09:38] (Version actuelle) – amine | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| <code sql> | <code sql> | ||
| + | drop table Employe if exists cascade constraints; | ||
| + | drop table Projet if exists cascade constraints; | ||
| + | drop table Embauche if exists cascade constraints; | ||
| + | drop table Grille_sal if exists cascade constraints; | ||
| + | |||
| + | create table Employe( | ||
| + | NumSS number(5) , | ||
| + | NomE | ||
| + | PrenomE varchar2(20) NOT NULL , / | ||
| + | VilleE varchar2(20) NOT NULL , / | ||
| + | DateNaiss date NOT NULL , | ||
| + | dateCour | ||
| + | / | ||
| + | / | ||
| + | constraint pk_emp | ||
| + | | ||
| + | / | ||
| + | constraint limite_age | ||
| + | check ((datediff(year, | ||
| + | / | ||
| + | constraint format_nss | ||
| + | | ||
| + | constraint ville_emp | ||
| + | check (lower(villeE) in (' | ||
| + | ); | ||
| + | |||
| + | |||
| + | |||
| + | create | ||
| + | NumProj Number(3), | ||
| + | NomProj varchar2(20) NOT NULL, | ||
| + | RespProj number NOT NULL, | ||
| + | VilleP varchar2(20) NOT NULL, | ||
| + | Budget number, | ||
| + | / | ||
| + | constraint pk_proj | ||
| + | primary key(numproj), | ||
| + | constraint fk_resp | ||
| + | foreign key (RespProj) references Employe on delete cascade, | ||
| + | constraint ville_proj | ||
| + | check (lower(villeP) in (' | ||
| + | constraint limite_budget | ||
| + | check (budget < | ||
| + | ); | ||
| + | |||
| + | create table Grille_sal( | ||
| + | profil varchar2(20), | ||
| + | salaire number(7, | ||
| + | / | ||
| + | constraint pk_sal | ||
| + | primary key (profil), | ||
| + | / | ||
| + | constraint sal_max | ||
| + | check (salaire< | ||
| + | ); | ||
| + | |||
| + | |||
| + | create table Embauche( | ||
| + | NumSS number , | ||
| + | NumProj number , | ||
| + | DateEmb date default sysdate NOT NULL, | ||
| + | Profil varchar2(20) NOT NULL, | ||
| + | / | ||
| + | | ||
| + | constraint fk_emb_emp | ||
| + | | ||
| + | constraint fk_emb_proj | ||
| + | | ||
| + | constraint fk_emb_sal | ||
| + | | ||
| + | ); | ||
| </ | </ | ||
site/enseignement/licence/2i009/donnees/tme8-creations-cascade-h2.1586849705.txt.gz · Dernière modification : de amine
