Re: Another simple Q from a beginner

From: <geoff_miller_at_my-deja.com>
Date: Mon, 02 Oct 2000 21:47:25 GMT
Message-ID: <8ravpb$c1c$1_at_nnrp1.deja.com>


In article <39D857B7.3D55DEE8_at_b.com>,   Snorkel <a_at_b.com> wrote:
> Prescription have already a datefield to keep them apart.
>
> Hugo wrote:
>
> > Dear All,
> > Here's a simple Q about the a database design :
> > 1)every patient has a primary physcian. every physcian can have
 several
> > patients.
> > 2)physcian prescribe drugs for patients.a physcian can prescribe
 one or more
> > drugs for several patients and a patient can obtain prescriptions
 from
> > several doctors. each prescription has a date and a quantity
 associated with
> > it.
> >
> > So could u pls tell me how to draw the ER disgram or tableif a
 doctor
> > prescribes the same drug for the same patient more than once,
 several such
> > prescriptions have to be recorded.
> >
> > thx a lot !!
>
>

Even if a doctor wrote multiple prescriptions for the same patient on the same day there shouldn't be a problem.

Patient Table

Doctor Table

Prescription Table
  Sequential number as key, automatically generated   Doctor
  Patient
  Date
  Drug
  Quantity

  ...

This also makes the assumption that each prescription is only for one drug, unless you're fortunate enough to be using a sensible DBMS which handles multivalued fields.

Geoff

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Oct 02 2000 - 23:47:25 CEST

Original text of this message