Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Here is how I would design it, John
Parent Table: item
NPK n(10)
cDefBarCode c(15)
cType (10) && type is either Normal, SerialNo or Matrix
Child Table: item_details
nPK n(10)
nFK n(10)
nQty n(10,2)
cColor c(10)
cSize c(3)
cBarCode c(15)
nSerialNo n(15)
The Trick when implementing the views:
1. a generic one for calculating Quantities in Stock (Normal and SerialNo Items) is to have all fields from item table plus sum(nQty) from item_details
2. Another View is paramterized on the item_detail table with nFK=nPK in the item table, include all fields in that table.
Hope that works for you.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement