List:General Discussion« Previous MessageNext Message »
From:Arthur Fuller Date:January 4 2010 2:40pm
Subject:Re: How Set Up This Table
View as plain text  
The ProductPackages table is what is known as an associate table, and is
used to implement a many-to-many relationship. You only need it if a given
product can be in multiple packages. If not, then you can eliminate the
associative table and just add a PackageID column to the Products table.

There's also a possible tiny wrinkle that may require another new column. I
once did an app similar to yours, with the many-to-many requirement. The
wrinkle was that a given package might contain several instances of a given
product (i.e. four jars of jam, for example). Because one of the goals of
the app was to generate a packing list, and the packages were assembled only
upon demand, the packing list told the shippers what to assemble. To meet
this requirement, I added a quantity column to the associative table, so
that in Package A there might be four jars of jam and in Package B only two.

hth,
Arthur

Thread
How Set Up This TableVictor Subervi1 Jan
  • Re: How Set Up This TableArthur Fuller2 Jan
    • Re: How Set Up This TableVictor Subervi2 Jan
      • Re: How Set Up This Tableprabhat kumar2 Jan
        • Re: How Set Up This TableVictor Subervi2 Jan
    • Re: How Set Up This TableVictor Subervi2 Jan
      • Re: How Set Up This TableArthur Fuller4 Jan
        • Re: How Set Up This TableVictor Subervi4 Jan