et pour tracer/historiciser les mouvements (mais est-ce vraiment nécessaire ?)
CREATETABLEMouvements(produitINTEGERNOTNULLREFERENCESProduits(id),quantiteINTEGERNOTNULLDEFAULT1CHECK(quantite>=1),origineINTEGERNOTNULLREFERENCESEmplacements(id),destinationINTEGERNOTNULLREFERENCESEmplacements(id),momentDATETIMENOTNULLDEFAULTCURRENT_TIMESTAMP,PRIMARYKEY(moment,produit),-- on peut remplacer moment ici ou le completer par origine,destinationCHECK(origine!=destination));
"It is seldom that liberty of any kind is lost all at once." ― David Hume
[^] # Re: structure
Posté par Gil Cot ✔ (site web personnel, Mastodon) . En réponse au message Sous requêtes et alias. Évalué à 3.
+1
Je m’attendais à avoir, dans ce cas simple, une table de liaison
et pour tracer/historiciser les mouvements (mais est-ce vraiment nécessaire ?)
"It is seldom that liberty of any kind is lost all at once." ― David Hume