Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table design best practices for products with diff units
Message
De
18/08/2006 05:00:25
 
 
À
18/08/2006 02:22:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01146649
Message ID:
01146663
Vues:
20
Hi,
>Let us supposed that for an inventory system, the products have diff units of packing. For instance, let's talk about Coke. Coke in a 1 liter bottle has a diff code than Coke in a 355ml can right? How about 1 liter Coke in a carton of 12s? Should it have a diff code than the individual Coke 1 liter?
>
>What would be a better practice? Have separate records for Coke 1 liter, Coke 1 liter 12's? OR provide additional fields for the Coke 1 liter records to accept 2 or maybe more packing units?
>

The solution probably depends on the percentage of items where this occurs. If the frequency is low I'd use the first option. I don't think I'd consider the second option at all - too inflexible (and 'flat-file'ish).

The *most* flexible option may be the old 'component/assembly' design using three tables (ideally allowing an assembly list to recursively contain other assemblies as well as components)
:
Components:
1 Coke 333 ml
2 Coke 1   ltr
3 Potato Chips
4 Sandwich
etc...

Assemblies (Inventory Items)
ID  Name     etc 
....
3 12 x 1Litre Coke Pack
4  6 x 1Litre Coke Pack
5 Large Coke with free chips
6 Deluxe Picnic Hamper

Assembly List
AID Component  Assembly  Quan
3   2                    12
4   2                    6
5   2                    1
5   3                    1
6                5       1
6   4                    1
etc. HTH,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform