Received: from inertia.home.kernel-panic.net (Montreal-ppp40017.qc.sympatico.ca [216.209.230.149]) by hub.org (8.10.1/8.10.1) with ESMTP id e67JcZW61420 for ; Fri, 7 Jul 2000 15:38:35 -0400 (EDT) Received: (from fluke@localhost) by inertia.home.kernel-panic.net (8.10.1/8.10.1) id e67JWOx21371; Fri, 7 Jul 2000 15:32:24 -0400 (EDT) Date: Fri, 7 Jul 2000 15:32:23 -0400 From: Antoine Reid To: Patrick Jacquot Cc: John , pgsql-sql@postgresql.org Subject: Re: confused by select. Message-ID: <20000707153223.A22141@inertia.home.kernel-panic.net> References: <3965A67C.9D1E6869@anpe.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.2i In-Reply-To: <3965A67C.9D1E6869@anpe.fr>; from patrick.jacquot@anpe.fr on Fri, Jul 07, 2000 at 11:44:30AM +0200 X-Archive-Number: 200007/86 On Fri, Jul 07, 2000 at 11:44:30AM +0200, Patrick Jacquot wrote: [snip] > > usually many-to-many relationships are handled by a third table, like this: > > create table items (item_id,...) > create table customers (customer_id, ...) > create table orders (customer_id, item_id, quantity_orderered) Hi! In real life situations, I can only see one possible problem with that. Let's say you have a product in stock, for a long period of time, and at some point, you need to change the description of the product... Now what happens when you look at your old invoices? They show up with the new description.. What if you need to delete a product? :) What if the shipping address changes? I have found, as a requirement in many of my projects, that we be able to view invoices/orders /exactly/ like they were.. It involves a different set of tables, one for the 'open' orders, inventory, etc and another set of tables, that are populated for every invoice. (Yes, that means lots of duplication..) > > Hoping it may help > > Patrick JACQUOT > just my 1/50$ CDN (for what it's worth nowadays...) Antoine Reid