Re: Simple data modelling problem.

From: Darkerus <darkerus_at_123.com>
Date: Wed, 16 May 2001 08:16:11 -0400
Message-ID: <9dtr1c$fos$1_at_ID-89233.news.dfncis.de>


Hi Lee,
> Can't I just store all of the products for every supplier in
>the product table, and for each product store the
>relevant supplier?

You can't do this, cause some products could have more than one supplier, and obviously suppliers supply more than one product, so the intermediate table suggested by Tasxa is a must. If you check relational database theory, it will be called a 'many to many' relationship between Products and Suppliers. This would be the optimal design to let the many-to-m,any work ok, avoidong redundancies in the data.

Table: SupplierProduct


Fields                     Use
----------------------------------------------
*IdProduct ---> Related to Product Table
*IdSupplier ---> Related to Supplier table *Price .- Sugested field for instance, Price given from the supplier to the product, could be useful, cause not all suppliers have the same price for the same product.
*Estimated production delay .- How much the supplier delays in having the product finished, in case of manufacturing by request.

> > Could you give me some example select statements for say, display a
 supplier
> > and their associated products?

Those 2 extra fields (price and Estimated delay...) would give you a snapshot of the usefulness of this intermediate table. I hope this helps. Best Regards. Received on Wed May 16 2001 - 14:16:11 CEST

Original text of this message