Modele Relationnel 2.41 KB
Newer Older
1
2
3
4
Adherent( #IdCarte: string, nom: string, prenom: string, email: string, login: string, motdepasse: string, numeroTel: string, Blackliste?: boolean) (nom,prenom) key
CHECK(nom is NOT NULL and prenom is NOT NULL and email is NOT NULL and login is NOT NULL and motdepasse is NOT NULL and numeroTel is NOT NULL and blackliste is NOT NULL)
CHECK(email is UNIQUE)

5
Contributeur(#nom: string, #prenom: string, #dateDeNaissance: date ,nationalite: string)
6
7
CHECK(nationalite is NOT NULL)

Sofiane Mahdjoub's avatar
Sofiane Mahdjoub committed
8
Personnel (#login:string , nom: string, prenom: string, email: string, mdp: string, numeroTel: string)
9
10
11
CHECK(nom is NOT NULL and prenom is NOT NULL and email is NOT NULL and mdp is NOT NULL and numeroTel is NOT NULL)
(nom,prenom) key
CHECK(email is UNIQUE)
Ismail Merzougui's avatar
Ismail Merzougui committed
12

13
14
15
Document(#code: string, titre: string, dateSortie: date, genre: string, langue: string, etat du document: {Bon,abime,neuf,perdu}, resume : string, editeur : string, Synopsis: string, ISBN: string, resume : string, duree : time, typeDoc:{Film,Musique,Livre})
CHECK(titre is NOT NULL and dateSortie is NOT NULL and genre is NOT NULL and langue is NOT NULL and ETAT is NOT NULL)
CHECK( (typeDoc = Film and duree is NOT NULL and synopsis is NOT NULL) OR (typeDoc = Musique and duree is NOT NULL and editeur is NOT NULL) OR (TypeDoc = Livre and ISBN is not NULL and resume is not NULL and editeur is NOT NULL))
Ismail Merzougui's avatar
Ismail Merzougui committed
16
17


18
19
20
21
22
23
24
EmpruntDocument(#code => Document, #Idcarte => Adherent,#dateEmprunt: date, duree: time ,dateRetour: date, dateLimite: date, etat d’emprunt: {Bon, abime, neuf, perdu}, etat de retour: {Bon, abime, neuf, perdu}, typeD: TypeDoc)
CHECK(duree is NOT NULL and etat d'emprunt is NOT NULL and typeD is NOT NULL)
CHECK( etat d'emprunt <= etat de retour)
CHECK( etat d'emprunt <> perdu)
(code,dateEmprunt) key, (code,dateRetour) key

PROJECTION(Document, code) INCLU dans PROJECTION(EmpruntDocument, code) (On s'assure que chaque document a au moins un contributeur)
25
26

Sanction ( #type de sanction:string, #date de debut:date, duree: time, date de fin: date, #IdCarte => Adherent)
27
CHECK(duree is NOT NULL and date de fin is NOT NULL)
28
29

ContributionDocument((#nom, #prenom, #DateDeNaissance) => Contributeur, #code=> Document, typeC string, TypeDoc => Document)
30
31
CHECK(typeC is not NULL and TypeDoc is not NULL)
CHECK( (TypeDoc = Livre and (typeC = auteur or typeC = editeur)) or (TypeDoc = Film and (TypeC = realisateur or TypeC = acteur)) or (TypeDoc = Musique and (TypeC = chanteur or TypeC = compositeur or TypeDoc = editeur)))