Re: Designing DB in accordance with the relational model

From: Erwin <e.smout_at_myonline.be>
Date: Thu, 11 Nov 2010 02:48:10 -0800 (PST)
Message-ID: <b5e63db1-cc25-4a06-a559-97d7b05952b0_at_j18g2000yqd.googlegroups.com>


On 11 nov, 00:54, Kentauros <joker..._at_gmail.com> wrote:
> On Nov 11, 12:39 am, Hugo Kornelis
>
> <h..._at_perFact.REMOVETHIS.info.INVALID> wrote:
>
> On Nov 11, 12:10 am, Erwin <e.sm..._at_myonline.be> wrote:
>
> > ??????
>
> > By including a relvar for that purpose in your DB design.  Plus the
> > needed relvars or attributes for documenting how characters relate to
> > games.
>
> Allright. The second approach.
>
> TYPE GAME POSSREP GAME {S  CHAR};
> TYPE ELEMENT POSSREP ELEMENT {S CHAR};
>
> TABLE Games {Game GAME,  OrdinalNumber INT}
>   PRIMARY KEY {Game};
> TABLE CharactersExistence{Character# CHAR_ID,  CharacterName CHAR,
> Game GAME}
>   PRIMARY KEY {Character#, Game},
>   FOREIGN KEY {Game} REFERENCES TO Games;
> TABLE ElementsExistence{Element ELEMENT,  Game GAME}
>   PRIMARY KEY {Element},
>   FOREIGN KEY {Game} REFERENCES TO Games;
>
> But it seems that the table Characters has to go — characters have
> different sets of characteristics in different games,

Then you need a relvar(/table) for the predicate "<character> has characteristic <characteristic> in game <game>.".

Plus perhaps an inclusion dependency (aka FK) to the relvar that holds the true instances of the predicate ""<character> appears in game <game>.". If you have a need for such a relvar (which will essentially be the case if characters can appear in a game without any characteristics).

> and I can't
> predict what will (dis)appear or which remained characteristic change
> -- except for name. I think I'd want to have a relation with predicate
> like "Characteristic <Name> with type <Type> existed in game <Game>",
> and I know how to do this... but I'm afraid of it and won't do it.

Well, then we're basically done talking.

BTW, did you consider that you didn't mention at all what it means _precisely_ for you to "be a game" ? And that you might be causing confusion in doing so ? By "a game" do you mean something like "Monopoly" (meaning it means more something like "a type of game"), or do you mean "the game of Monopoly that was played between x, y and z on april, 1 at 2PM" ?

To you, it's probably obvious. Learn to realise that to others, it usually isn't. Received on Thu Nov 11 2010 - 11:48:10 CET

Original text of this message