From: "Darkerus" <darkerus@123.com>
Newsgroups: comp.databases,comp.databases.theory
Subject: Re: Simple data modelling problem.
Date: Wed, 16 May 2001 08:16:11 -0400
Lines: 34
Message-ID: <9dtr1c$fos$1@ID-89233.news.dfncis.de>
References: <990002098.11778.0.nnrp-01.c2de1f0e@news.demon.co.uk> <9dtg32$dgn$1@news.eunet.yu> <990005765.13303.0.nnrp-01.c2de1f0e@news.demon.co.uk> <990006597.13581.0.nnrp-01.c2de1f0e@news.demon.co.uk>
NNTP-Posting-Host: 63.65.12.178
X-Trace: fu-berlin.de 990015342 16156 63.65.12.178 (16 [89233])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700


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.



