Re: Newbie question on database design

From: Tobin Harris <comedyharris_at_hotmail.com>
Date: Fri, 25 Oct 2002 15:35:52 +0100
Message-ID: <apbksf$5lf8$1_at_ID-135366.news.dfncis.de>


> My question is, why not using a talbe to hold ALL of the above relations
> I was thinking of something like this:
>
> Table: Users
> Fields: UserID, Name
>
> Table: Companies
> Fields: CompanyID, Name, Address
>
> Table: URLs
> Fields: URLID, URL
>
> Table: ALL_Relations
> Fields: RelationID, Related_URL_ID, Related_User_ID,
> Related_Company_ID
>
> Is this against good database design practice?

It looks pretty bad to me, but it depends on the rules of the business who's system you're developing 8-) If I understand you correctly, it looks like you may introduce a lot of redundancy, becuase not every relation should involve all entities (so 2/4 columns might be null for each row). Also, if you introduce new entities then you would have to add new columns to the ALL_Relations table, again possibly increasing redundency. And, if you have composite keys then this gets worse.

From a communications perspective, it's not too good either since I'd assume this would replace the use of foreign keys between tables. People are used to seeing these since it helps us understand the relationships between entities.

I think this also is violating 2NF, since the columns are not dependent on the key.

Lol, I may be wrong on a few points here, but there's my 2p worth anyway!

Regards,

Tobin

> I would appreciate any comments
>
> George
>
>
>
>
>
Received on Fri Oct 25 2002 - 16:35:52 CEST

Original text of this message