12.2 Les animaux du zoo
297
© Dunod – La photocopie non autorisée est un délit.
Contrainte : Pour toute entité BESOINS b, b.Max >= b.Min
Figure 12.1 - Schéma conceptuel du domaine d’application ZOO
12.2.4 Production du code SQL
L’expression de ce schéma en structures de tables s’effectue également sans difficulté.
create schema ZOO;
create table ESPECE (
NOM_ESPECE char(32) not null,
primary key (NOM_ESPECE));
create table ANIMAL (
NOM_ANIMAL char(32) not null,
POIDS numeric(8,4) not null,
NOM_ESPECE char(32) not null,
primary key (NOM_ANIMAL),
foreign key (NOM_ESPECE) references ESPECE);
0-N
1-1
suit
0-N
1-1
origine
0-N
1-1
objet de
1-1
0-N
en
1-1
0-N
en
1-1
0-N
en
1-1
0-N
a
1-1
0-N
a
1-1
0-N
a
TENEUR
Quantité
id: en.NUTRIMENT
a.INGREDIENT
SOINS
Date soins
Coût
id: objet de.ANIMAL
Date soins
REGIME
Date régime
id: suit.ANIMAL
Date régime
NUTRIMENT
Nom nutriment
id: Nom nutriment
INGREDIENT
Nom ingrédient
Coût unitaire
id: Nom ingrédient
ESPECE
Nom espèce
id: Nom espèce
COMPOSITION
Quantité
id: en.INGREDIENT
a.REGIME
BESOINS
Min
Max
id: en.NUTRIMENT
a.ESPECE
ANIMAL
Nom animal
Poids
id: Nom animal
Précédent

- 297/436

Suivant