From: Ryan <[EMAIL PROTECTED]>
> While I agree that it would be a good homework assignment it's not.   
> What I have is a logic look up table for health records using an EAV  
> model (in an SQL table):
> 
> rowID ----- key ----- value
> 
>  From a web form I select some keys and values. When submitted, I  
> create a new rowID and put in the keys and values:
> 
> a1    k1      v1
> a1    k2      value
> a1    k3      cheesecake
> a1    day     Thursday
> 
>    If a key has multiple values, I need to enter multiple rowIDs:
> 
> a2 num        6
> a2    k1      v1
> a3    num     7
> a3    k1      v1

Why?

Apart from the existence of a too restrictive PRIMARY KEY or UNIQUE 
INDEX constraint I do not see any reason not to store this as

a2  num  6
a2  num  7
a2  k1   v1

> Anyway, then what happens is I take a patient's list of keys/values  
> and compare it to what's in these logic tables, then get the rowID and  
> that corresponds to another table that helps me to get analytical text  
> regarding the various sets of keys and values.

If all you want is to get the list of row ids that match some 
combination of keys and values, then the duplication just gets in the 
way.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to