Re: Can I use an n:n relationship here?

From: Sean Kraft <seankraft_at_yahoo.com>
Date: 18 Jul 2002 05:56:18 -0700
Message-ID: <3dd57adc.0207180456.4309f22e_at_posting.google.com>


> Now suppose that we want to query the following from the system:
> (Sorry, it's just a guess...)
> * Source, Source-type of the particular Transaction;
> * IF Source-type is File, all File-sections of that File.
> * ....
So you are saying that I should store the HTTP source (or any source) as well as the the file and file section? This seems to make sense, then I would eliminate the problem of not having a parent record for a transaction.

The query above is exactly what I need, and the other queries would want to retrieve the HTTP information or whatever specific information comes in the future.

> Consider entities have the following possible attrributes:
> * Transaction (Unique ID, Source, Source-type, Date-time, ...)
> * File (Name, Date-time, Size, ...);
> * File-Section (Name, Date-time, Size, ...);
> * HTTP-Source (URL, Date-time, Size, ...);
With this model "Transaction.Source" would hold a foreign key to whatever table the source is in? So you are saying I should eliminate the "associative" table and add a SOURCE_TYPE table that will aid in the query mentioned above?

This way I could add a new source by adding a new table to hold the source (ex:TB_EMAIL) and then add a row to SOURCE_TYPE, and I would be ready to go.

Thank you for providing such a well thought out answer so far.

,Sean Received on Thu Jul 18 2002 - 14:56:18 CEST

Original text of this message