3 Replies Latest reply: Apr 12, 2013 8:31 AM by InoL RSS

    inserting with many to many relationship

      db and dev 10g rel2 ,
      hi all ,

      an application for a laboratory ,( patients and tests)

      i think the relation here is (many to many) , because each patient can have multiple tests, and each test can
      have multiple patients .
      what tables should i create ?

      and finally i should have a block to insert data for patients , and it should have
      the name of the patient and the test he is doing .

      so what tables should i create , and the block for the data entry will be based on which table ? or tables ?

      thanks a lot
        • 1. Re: inserting with many to many relationship
          Amatu Allah Neveen Ebrahim
          First i do strongly recommend collecting reports & forms papers which r filled out by Mrs employees & patients then u stay to decide by ur pen & formalize what r the data required & what type of relationship need to be contracted from scratch off course many modifications Will occure by it Will be easier to modify on papers.

          Then my guess is u.Will need tables for employees , Patients ,Labs & Analysis Types

          Employees & Patients fields in a table r common in ;name, id,address,birthday or age ,
          Labs table is needed if only u have many labs types ...
          Analysis Types table is listing...
          Analysis_id , Analysis_name& comments if any...
          Actual_Analysis table which Will have many pk is from all previous tables e.g.
          employees_id,Analysis_id, Patient_id,Lab no
          Analysis time , Delivery or due time.
          Status +-- A flag Which indicates ethe delivery status done or not
          way payment -- can have a table for it.

          total cost
          All payments affairs could have a table or more for it

          hope it.helps as a start.

          Amatu Allah
          • 2. Re: inserting with many to many relationship
            wait ,wait , wait

            i do not need all of this as a start , i just need to know how to insert if i have three tables with many to many relationship .

            if i am inserting patient's data , i will insert his name and more than one test , how to do so ?

            just this

            thanks a lot
            • 3. Re: inserting with many to many relationship
              This is not really a Forms related question. You are asking how to set up a relational data model. Once you have a proper model, creating the forms is not so difficult (using the wizard).
              I suggest you do some basic research on data modelling first. There are many tutorials on internet about this topic. Here's the first one I found: