| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Simple data modelling problem.
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.
> > 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 - 07:16:11 CDT
![]() |
![]() |