| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Question on Multiplicity
It may also depend on how much detail you want to record and why.
To get really fancy, you could make a table listing "pattern":
id | pattern
1 | entirely 2 | stripes 3 | spots 4 | background 5 | rings
and, if you wanted to be incredibly fancy, "parts":
id | part
1 | body 2 | foreleg 3 | hindleg 4 | wing 5 | head 6 | tail
And then you could encode the information that "pandas have black spots; pandas' bodies have a white background; pandas have black forelegs; pandas have black hindlegs" in a fifth table that just linked the ids (each statement would be a separate record):
speciesid -> partid -> patternid -> colorid
The question you'd have to ask first is, WHY? What do you want to record, what will you be using the information for? What do you want to be able to search for.
If you need a list of "all animals with brown or white heads but no stripes anywhere on their bodies," the more complex structure would be the way to go.
If ALL you need is, "given a species of animal, tell me what it looks like," you might only need a string describing the animal (panda: "mostly white body with black legs and black spots around the eyes").
HTH, Bruce
"jason.glumidge_at_gmail.com" <Jason.Glumidge_at_gmail.com> wrote in message
news:1130348425.226719.139110_at_f14g2000cwb.googlegroups.com...
> Roy Hann wrote:
>> "jason.glumidge_at_gmail.com" <Jason.Glumidge_at_gmail.com> wrote in message >> news:1130334318.730554.140170_at_f14g2000cwb.googlegroups.com... >> > Imagine you were knocking up a simple table of animals and their >> > predominant colors. Something of the order: >> > >> > ---------------------- >> > animal | color >> > ---------------------- >> > swan | white >> > lion | yellow >> > oranguatan | orange >> > ---------------------- >> >> To see what is going on here, ask yourself what sentence you intend to >> plug >> these words into to form true statements. (i.e. what is the predicate?) >> Here are some suggestions: >> >> All <animal> are <color>. >> Food for <animal> is stored in warehouse zone <color>. >> A <animal> can be entirely <color>. >> A <animal> is >93% <colour>. >> A <animal> can be partly <color>. >> A <animal> can never be <color>. >> T-shirts with <animal> logo are <color>. >> >
>
>
> >> > Consider also that some animals that have multicolored fur. For >> > instance a zebra is black and white. Keeping the table nice and >> > normalized yields: >> > >> > ---------------------- >> > animal | color >> > ---------------------- >> > swan | white >> > lion | yellow >> > oranguatan | orange >> > zebra | black >> > zebra | white >> > ---------------------- >> >> It would appear that you have a table but you don't know the predicate, >> or >> you know the predicate and the table is wrong. >> >> [snip] >> > Now my question is am I missing anything - is there any method of >> > making this distinction without having to introduce a new reference >> > column to resolve the ambiguity? >> >> You'll need to decide on the predicate, and it's not clear to me that you >> have one. You might even find you need multiple predicates (and multiple >> tables). >> >
>> id | animal_name
> -----------------
>
>
>
![]() |
![]() |