Re: Designing DB in accordance with the relational model

From: Erwin <e.smout_at_myonline.be>
Date: Wed, 10 Nov 2010 13:10:59 -0800 (PST)
Message-ID: <37aed956-a690-467e-a9a5-fbf669eb6df7_at_30g2000yql.googlegroups.com>


On 10 nov, 20:37, Kentauros <joker..._at_gmail.com> wrote:

> (Sorry for long post). This design, however, has a certain flow: There
> will be new games III, IV, V, and so on. And I can't write a universal
> query to answer a question "How many characters is in every game?"
> This is partially because DB doesn't represent the fact that games
> themselves are things to be taken into regard. Unfortunately, I don't
> know how to take them into regard.

??????

By including a relvar for that purpose in your DB design. Plus the needed relvars or attributes for documenting how characters relate to games.

> Second, how do I declare ELEMENT2?
>
> ELEMENT2 = ELEMENT UNION {"NEWELEMENT1", "NEWELEMENT2"};
>
> or
>
> ELEMENT2 = {"WATER", "FIRE", "NEWELEMENT1", "NEWELEMENT2"};
> ELEMENT IS ELEMENT CONSTRAINTED {ELEMENT <> "NEWELEMENT1" AND ELEMENT
> <> "NEWELEMENT2"};
>
> I don't actually know. :(

If you are referring to the TTM inheritance model, it is hard to say anything sensible in an attempt to answer your question. Except perhaps that TTM does not seem to suggest (and "Database Explorations" seems to suggest this is a rather deliberate choice) something akin to your ' ELEMENT2 = ELEMENT UNION {"NEWELEMENT1", "NEWELEMENT2"}; ' stuff. But I'm too uncertain to make definite statements about that. Received on Wed Nov 10 2010 - 22:10:59 CET

Original text of this message