Correct db design // Stan, I have found interesting solution for you.

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jul 17 13:08:19 CDT 2006


On 7/16/06 10:54 PM, "Stan Busk" <maxprog at mac.com> wrote:

Hi Stan,

> Actually I can't do that because of how Usenet works.
> It is all about  cross-posting.

right

> That is, an article can be posted to as many groups as
> the sender wish. 

Right! 

So you have relation between Groups to Articles as MANY to MANY.

> As a result, the 'Article_Newsgroups' field can
> contain 1, 2, 5 , 10 newsgroups and sometimes much more.

In your design yes.

In CORRECT design this field must not exists at all!


> If I search  newsgroups like Article_Newsgroups = 'alt.comp.shareware' I will
> only  get article that was posted to that one only group and will not get  all
> the articles posted to 'alt.comp.shareware' between others.

This is I already have explain in my prev letter.

> This  is the reason why the 'Article_Newsgroups' field is a list and as I
> don't know how many groups it will contain I can't split it into  several
> fields...

And here again I want to show CORRECT solution:

* you have between tables Groups and Articles MANY to MANY relation.

* the Classis solution in Relational model for this task is --
    to create third table which contains 2 fields of IDs

    Table GroupArticles { GroupID, ArticleID }

* you have now 

    Table Group
    ---------------             -----------------------------
    ID     Name                 ID  ArticleGroup            Field3
    ---------------             -----------------------------
    1      group1               1    group1,group3
    2      group2               2    group1,group2,group3
    3      group3               3    group3
                                4    group2, group3


* correct design is using RELATIONAL model is:

    Table Group
    ---------------             -----------------------------
    ID     Name                 ID   Field3
    ---------------             -----------------------------
    1      group1               1
    2      group2               2
    3      group3               3
                                4

    
               Table GroupArticles
               ------------------------
               GroupID     ArticleID
                  1             1
                  1             2
                  1             3
                  2             2
                  2             4
                  3             1
                  3             2
                  3             3
                  3             4


* This third table in Valentina 2 can be replace by BinaryLink.
    Benefits of BinaryLink you can read here:

http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:vkernel:vlink:vlink


                   
-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list