Skip to content

The prescription key

The situation

A small clinic wants to replace its paper records.

  • Patients have a registration number, a name and a date of birth.
  • Doctors have an employee code, a name and one specialisation.
  • A patient books an appointment with a doctor at a date and time. A
  • patient may have many appointments; a doctor sees many patients.
  • Each appointment may produce a prescription listing one or more
  • medicines with a dosage. A prescription belongs to exactly one appointment
  • and means nothing without it.
  • Prescriptions are numbered 1, 2, 3 within each appointment.

Prescriptions are numbered 1, 2, 3 within each appointment. What is the primary key of the prescription table?