Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Location
    Brussel, Belgium
    Posts
    2

    Help with specification in relational database

    Hello everyone.

    I'm facing a common problem but i can't find any right solution.

    Look at this :
    In our biological center we received every day a lot of samples.
    Our samples can come from human (blood samples) animals (part of animal, blood sample, ...) and sometimes from water, food, ... that we have to analyze.

    Due to the fact that each category (human, animal and "others") has it's own specification, i need relevant forms to fill the data corresponding to the sample's category

    How do you see that ? Moreover it's an exclusive selection. A sample can only be human or animal or other. And i don't want to make a huge table called "sample's source" and put in it all the necessary fields.

    But a human or an animal or anything else can be related to various samples so the foreign key must be in the sample table and i don't think it's pretty or good coding to see such things :

    SAMPLE ( id_sample, quantity , arrived_on , ... , type, id_human, id _animal, id_other )

    Is there another solution ? I'm getting headache with that ...

    Thanks a lot for your precious time and your help

    Kindly

    __________________

    Francois Verbeeck
    Belgium

  2. #2
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    Why don't you create a table:

    SAMPLE_CATEGORIES:
    id PRIMARY KEY,
    category,
    specification,
    form_name

    SAMPLES:
    id PRIMARY KEY,
    sample_cat REFERENCING SAMPLE_CATEGORIES(id),
    qty,
    arrived_on

    In this case you can always add new categories without having to change your db-layout.
    rws

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •