Re: Database design, Keys and some other things

From: vldm10 <vldm10_at_yahoo.com>
Date: 25 Sep 2005 18:48:00 -0700
Message-ID: <1127699280.011880.214310_at_g49g2000cwa.googlegroups.com>


>
> If you are using the RM as typically taught rather than the RM that
> includes nested relations, then along with a PaintColor table, you
> would have a relationship table between PaintColor and Car, perhaps
> named CarColor. That table could be seen as an event table with
> paintDate and colorReplacedDate or paintDate and paintStatus (a date
> range or a combination of date and status).
>
> So the Car table includes facts about Cars and the relationship table
> CarColor includes facts about the car colors. The relationship table
> has a candidate key that consists at least of the Car ID and the Color
> ID.

If one car changed color (or any attribute) and had same color (attribute value) in two different periods this key doesn't work. You need to add date or some status or anithing else.

>If you want it to be more activity/event based about when the car
> was painted, then it would also include a starting date. Otherwise a
> compound candidate key of car id and color id might work. Make sense?
>
> > 2. Let SSN be the primary key for the table Person. How we can enter
> > information in the
> > table Person that Mary Adams changed her name again to Mary Jones
> > - she got divorced.
> > These two questions show one limitation in the RM.
>
> This is pretty much the same question, so you can use a similar
> approach. This does not show a limitation in the RM, although we might
> way that it shows a human-computer-interaction issue. --dawn

This is the way how people usually practically work, but there are some things which are not defined in the theory. In the RM and the ER Conceptual Model there are no events. You mentioned Event table, but what is event. We know that event is one of the most general concepts in the Real World.
The second think, that we use often is the date or the time in the construction of an entity and a relationship. Can a date be an attribute of an entity? Can for example a date be an attribute of some person? I don't believe. Not to mention that time or date for some attribute's value can has three different values in the Real World, the Conceptual Model and the Logical Model respectively. I defined a date as a part of a knowledge related to some data, so it is not an attribute. Now I have a problem with the assumption that date is not attribute, I can't use date as key (or as a part of the key) because in the key definition (for RM) states that the key is an attribute or set of the attributes. It is similarly with things like a status, an indicator, etc. I think that these are limitation in the RM. I also think that the Relational Model is the best database model, but there are things which are not cavered with the theory. (Of course this is just one opinion)

Vladimir Odrljin Received on Mon Sep 26 2005 - 03:48:00 CEST

Original text of this message