Re: Question About Data Model

From: Alex Petrov <master.db_at_mail.ru>
Date: Sat, 13 Jul 2002 00:57:28 +0000 (UTC)
Message-ID: <b44aa8c699440fec76e7d0252a8e059f.54296_at_mygate.mailgate.org>


Hi,

>The first idea was just to implement the following:
>
>Pub Table -(1-many)- Pub_Country Table -(many-1)- Country Table
>--------- ----------------- -------------
>Pub_ID Pub_ID Country_ID Country_ID
>
>And do something similar for Keywords.

This is a standard to resolve many-to-many relationship into one-to-many ones way using associative tables (Pub_Country, Pub_Keywords). But I don;t understand why you can't hold keywords list for Publication in the Pub Table (it's the most common approach for these things)?

>The thing is that I feel that this is not a particularly intelligent
>solution: adding further 'Groups' in the future involves creating
>entirely new conceptual relationships.

This is the real bad thought! I don't know what is the purpose of your data model but you should think of the static ("frozen") data model when the the model/schema once defined and doesnt change untill you want to upgrade/modify it again.
I think it's not the situation where you have to implement 'extendable data model' that allows any desired set of attributes (e.g such things are usually required in complex document management systems (DMS) because there are companies that use a set of document templates/descriptions which in turn can change).

>I was thinking along the lines of a SuperGroups Table that categorised
>each Group.
>
>But my design then looked like this:
>
>Pub Table -(1-many)- Pub_Group Table -(many-1)- Country(Element)
>Table
>--------- ----------------- -------------
>Pub_ID Pub_ID Group_ID Element_ID Element _ID

I don't understand what you want but, for example, if you want to 'categorize' countries, you can create a Region table for generalizations/super categories like 'North America' (for countries: USA,Canada,Mexica),'Europe' (for: EC,Poland,Slovakia,Russian Federation,..),'Australia','Middle East',etc. Then Country table should have an attribute/column named 'Region' which is Foreign Key that referencing Primary Key of the Region table.

Hope this helps...

Alex P
Sys Analyst,mcdba,ocp

~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~ From: lorenzogordon_at_hotmail.com (Lorenzo Gordon) Subject: Question About Data Model
Date: 12 Jul 2002 03:56:58 -0700
Organization: http://groups.google.com/

Hi,

I'm trying to find an appropriate general method for modelling the following relationship:

There is a Publication table with publication details. For each publication, there are certain groups of terms that can be assigned to it.
The main two are: Which Country it relates to; and which Areas (keywords) it deals with.

The first idea was just to implement the following:

Pub Table -(1-many)- Pub_Country Table -(many-1)- Country Table

---------             -----------------            -------------
Pub_ID                Pub_ID Country_ID            Country_ID

And do something similar for Keywords.

The thing is that I feel that this is not a particularly intelligent solution: adding further 'Groups' in the future involves creating entirely new conceptual relationships.

I was thinking along the lines of a SuperGroups Table that categorised each Group.

But my design then looked like this:

Pub Table -(1-many)- Pub_Group Table -(many-1)- Country(Element) Table

---------             -----------------          -------------
Pub_ID                Pub_ID Group_ID Element_ID   Element _ID


Group Table



Group_ID (Countries)

Which doesn't make things any better - in fact it is more complicated and makes less sense.
I am feelign a little confused and would appreciate any ideas: does it make sense what I am trying to do? And is it worth the effort? i get this feeling that I am on the right lines, but perhaps missing the wood for the trees.

TIA,
Lorenzo.

-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Sat Jul 13 2002 - 02:57:28 CEST

Original text of this message