Question

I have been at this for hrs flipping through videos and examples online. Can someone please help to take a look and point out if I am right or wrong in which portion please. I am trying to change the following table into 2NF. Thank you.

Clinic      Address      Therapist  TherapistTel    Appointment         Client    ClientTel
Clinic A    123 High St  J Smith    77882233        25/01/2013 11:00    A Jones   32512
Clinic A    123 High St  P Taylor   77235846        25/01/2013 13:00    I Davis   34251
Clinic B    80 Low St    B Morris   77991487        25/01/2013 10:30    H Kelly   53692
Clinic C    3 Middle St  J Smith    77882233        26/01/2013 14:00    Y Rimmer  68595
Clinic B    80 Low St    J Smith    77882233        26/01/2013 09:30    H Kelly   53692
Clinic A    123 High St  B Morris   77991487        25/01/2013 14:00    J Steele  36529

My 2NF Tables as follows:

Clinic

**Clinic**      Address      **Therapist**
Clinic A    123 High St  J Smith
Clinic B    80 Low St    P Taylor
Clinic C    3 Middle St  B Morris

Therapist

**Therapist**   TherapistTel
J Smith     77882233
P Taylor    77235846
B Morris    77991487

Client

**Client**    ClientTel
A Jones   32512
I Davis   34251
H Kelly   53692
Y Rimmer  68595
J Steele  36529

Appointment

**Therapist**      **Client**   Appointment
J Smith        A Jones  25/01/2013 11:00
P Taylor       I Davis  25/01/2013 13:00
B Morris       H Kelly  25/01/2013 10:30
J Smith        Y Rimmer 26/01/2013 14:00
J Smith        H Kelly  26/01/2013 09:30
B Morris       J Steele 25/01/2013 14:00
Was it helpful?

Solution

As noted in comments back in January 2014:

Your Clinic table has a number of problems, most notably that P Taylor is not associated at all with Clinic B. You need a table to connect clinics and therapists. Your appointments table has problems too; neither the patients nor the therapists know which clinic to go to in your schema, whereas the original does tell them where to go.

There's more than one therapist per clinic, in general. Further, a given therapist works at more than one clinic. So, you need a list of clinics, a list of therapists, and a list that identifies each pair of clinic+therapist. In appointments, therapist J Smith can be at any of the three clinics; how does A Jones know from the appointments table that the appointment with J Smith is at Clinic A, not B or C? You're missing that key information. You need date, time, therapist, client and clinic all in the appointment table.

The Client and Therapist tables are fine. The Clinic table should consist of Clinic and Address columns only. Your appointment table needs 4 columns:

  • Clinic
  • Therapist
  • Client
  • Appointment (date and time)

You might or might not need another table Therapist_Clinic which specifies which therapist can serve at each clinic. For the given data, it might contain:

Therapist_Clinic

Clinic      Therapist
--------    ---------
Clinic A    J Smith
Clinic A    P Taylor
Clinic B    B Morris
Clinic C    J Smith
Clinic B    J Smith
Clinic A    B Morris

On the other hand, if each recorded therapist can work at any of the clinics, this table is superfluous.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top