Re: Database table "triangle"... allowed or not

From: Trooper <andrew_zx5_at_NOSPAMyahoo.com>
Date: Sun, 06 Apr 2003 16:07:02 GMT
Message-ID: <GgYja.59642$vs.3851955_at_news3.calgary.shaw.ca>


> > user
> > ===
> > user_id PK
> > email
> >
> >
> > auction_group
> > ==========
> > auction_group_id PK
> > user_id FK
> > auction_id FK
> > description
> >
> >
> > auction
> > =====
> > auction_id PK
> > auction_group_id
> >
> >
> >
> > In this way, I can relate the auction to the user through
> > the auction_group. Seems reasonable...
> >
> > Well, I'd appreciate any comments on this.
> > Thanks,
> > Trooper
> >
> > 05-April-2003
> > ==========
> Your second idea is wrong, as it means a group can only contain
> one auction!
>
> The first model is better, and it is not wrong. It states correctly
> that users can create auction groups, and users can create auctions, and
> that the auctions may be assigned to auction groups. That's OK.

Thank you for your reply. And my appologies about that unfortunate field in the auction_group table. the auction_id field should not be in there. Once again:

user
===
user_id PK
email

auction_group



auction_group_id PK
user_id                 FK

description

auction



auction_id PK
auction_group_id

Now what I'm seeing is this. Due to the fact that I want users to be able to track auctions by group, this now makes sense because it makes it manditory to have a group to put an auction into (whether they create it before hand, or at the time of inserting the auction).

If, as you say, the first method (triangle) is acceptable, that's good to know. However, due to my requirements, I think the second method is the one I need to go with... don't want someone creating an auction without a group.

Thanks once again.
Trooper

06-April-2003


Received on Sun Apr 06 2003 - 18:07:02 CEST

Original text of this message