Vous êtes sur la page 1sur 2

Delphi réseaux

Titre : création d’une base de données

Sur interbase (suite)

Exercice : location du matériel


Client Contrat

Cod-cli Num-ct

Nom-cli (1 ,n) Passe (1,1 ) Date-ct

Prénom-cli (1,1 ) Durée-ct

Rue-cli (1,n)

Ville-cli

Concerne Comporte

Qte

Agence (0,n)

Num-ag (1,n) (0,n)

Nom-ag Stocké Matériel

Qté-diop (1,n) Ref-mat

Design-mat

P.V-mat

Questions :

1-Donner MLD vers MCD.

2- Donner MPD.

2-1- Créer cette base de données avec l’interbase sous le nom location du matériel.GDB.

2-2- créer les tables.

2-3- ajouter les attributs Adr-cli , Tel-cli à la table client.

2-4- Créer la table commande qui contient les attributs Num-cmd , Date-cmd.

2-5- Supprimer l’attribut Num-cmd à la table commande.

2-6- Changer l’attribut Ville-cli par l’attribut Cod-post-cli.

2-7- Ajouter l’attribut Id-cmd come une clé primaire à la table commande.

2-8 Ajouter l’attribut Num-cli come une clé étrangère à la commande.


Delphi réseaux

Réponse :

1- create table client ( Cocli intègre not null primary key , Nom-cli varchar(25) not null , Prenom-
cli varchar(25) not null , rue-cli varchar(25) not null , ville-cli varchar(25) not null ) ;

2- create table contrat ( num-ct intègre not null primary key , Date-ct Date , durée-ct varchar(25)
not null , cocli intègre , foreign key (cocli) references client, num-ag intègre , foreign key (num-ag)
references agence) ;

4- create table comporte ( num-ct intègre not null , ref-mat varchar(25) not null , Qte-louée intègre
not null , primary key (num-ct,ref-mat) , foreign key (ref-mat) references matériel ) ;

3- create table matériel ( ref-mat varchar(25) not null primary key , design-Mat varchar(25) not null ,
P.V numeric (5,2) ) ;

5- create table Agence ( num-ag intègre not null primary key , nom-ag varchar(25) not null ) ;

6- create table Stoker ( num-ag intègre not null , ref-mat varchar(25) not null  , Qté-diop intègre
not null , primary key (num-ag , ref-mat ) , foreign key (num-ag) references agence , foreign key(ref-
mat) references matériel ) ;

Vous aimerez peut-être aussi