My teacher always asked us to create simple but precise databases. Being able to explain it simply but not without leaving the theory "to your wise but aged loved Grand'ma"...
I have to create a database to model the stocks of a firm which commercialize constructing industry products. A same product (Produit) can be bought (Achat) from suppliers (Fournisseur(s)). Client(s) place orders (Commande(s)) which will be used on different construction sites (Chantier(s)). An order is composed (Composition) by severals products. For each of them a discount can be done as a percentage of the selling price. Every order can be delivered in several times. The total quantity of a product can be allocated in several delivery notes (Bon de commande).
This is described in UML in the following pics:
Therefore we should have:
- Fournisseur
- Achat
- Produit
- Composition
- Commande
- Client
- Chantier
- Livraison
- ContenuBL
- BonDeLivraison
The scheme modeling the database is the following one
with the following Latex Code
! $Achat(\underline{#IdFourniseur},#IdProduit,PrixVente,Date)$
! $Fournisseur(\underline{IdFourniseur}, NomFournisseur, NumérotSIRET,NuméroTel)$
! $Produit(\underline{IDProduit},PrixVente,QuantiteEnStock)$
! $BonDeLivraison(\underline{NuméroBon},AdresseLivraison)$
! $Commande(\underline{IDNuméroCommande},Date)$
! $Client(\underline{IDClient},AdresseClient,NomContact,NuméroSIRET)$
! $Livraison(\underline{#RefChantier},\underline{#IDProduit},\underline{#NumeroBon},Date)$
! $ContenuBL(\underline{#IDProduit},#NuméroBon,Quantité)$
! $Chantier(\underline{#RefChantier},ResponsableChantier,AdresseChantier)$
Yet, I'm not sure about it, especially because the associations between "classes", are not always shown in the scheme.
- I'm not sure about Livraison for instance, which links ContenuBl and Chantier but therfore Produit and BonDeLivrasion to Chantier
- I'm not sure about Client, which as an Association Qualifier and how to lin it between two classes which are not association classes
Furthermore, I created these relations by reflex. How to be able to explain to my loved Grand'ma why I always use Foreigner Kyes to association classes and not For simple classes ?
- What leads to establish the relations I did, if they are right and optimal?