Re: Data design question - newbie

From: GoranG <no_at_spam.net>
Date: Mon, 12 Aug 2002 17:10:29 +0200
Message-ID: <sahflu8ir14op1d8ippu8114j4cdi77gnn_at_4ax.com>


On 5 Aug 2002 14:33:07 GMT, rob_at_benefitscheckup.org wrote:

>Hi Stu,
>
>Thanks for the response!
>
>I am sorry that my question wasn't clear about the types of responses
>possible. I was trying to show that depending on the answerfield, the
>expected resonse could be a number, a boolean, a string or specific value
>from a set.
>
>I want to figure out a way to insure integrity so that I don't have a
>situation where I get the Answer: '82' to the question 'Are you male or
>female?'. Aside from having a separate table per answer I am not sure how to
>do this....
>
>Any thoughts?
>Thanks a lot Rob
>
<cut>

Sooner or later someone is going to put a proposition (not me) to use OODB, so before that happens you might want to search through the group's archives on that subject and read a bit (cause it will sound tempting). You might want to search for terms like metadatabase as well while you are at it.

Re relational - AFAI understand... the sheer number of tables should not frighten you... Who cares if you'll have couple of hundred question tables?
If you want to insure proper integrity go a head and create couple of hundred tables and apropriate relations and constraints and all (do create them programatically from a metadatabase by all means).

Now, don't create unneccessary tables... If you examine your questions and answers you might find that you don't need a table per answer, but you need a table per answer's domain (or even less when you see that some domains are supported by the database) and that single valued answers become properties of the main data table and 'many-valued' should go to their separate tables.

At the end if you want integrity control you'll have to do it at some level and closer to engine the better. If you use your design mixing entities, properties and mixing types or if you use proposed solutions with multiple base type properties you'll end up checking integrity at application level. At the end you will do the same work on less appropriate place, that is: it will be same work if you'll try to achieve the same level of integrity control.

( GoranG79 AT hotmail.com ) Received on Mon Aug 12 2002 - 17:10:29 CEST

Original text of this message