Question

I have a table to track the surgeries in a hospital called Surgery_Record as below.

surgery_Record_ID   patient_ID    surgery_ID        theatre_ID     Surgery_Date
        1               1             20               0           2000-05-10
        2               85            20               0           2000-01-15
        3               10            20               0           2000-01-29
        4               13            16               0           2000-11-19
        5               15            1                0           2000-05-28

My assumptions are that:

  1. No revisiting of patients
  2. Every patient has only one surgery done
  3. A particular operation Theatre is used only one time in a day

I figured out the following Functional Dependencies:

  1. Patient_ID, Theatre_ID---> Surgery_Date
  2. Surgery_Record_ID---> Patient_ID
  3. Patient_ID---> Surgery_ID, Surgery_Record_ID, Theatre_ID
  4. Patient_ID, Surgery_ID--->Theatre_ID
  5. Surgery_Record_ID, Patient_ID, Surgery_ID, Theatre_ID---> Surgery_Date

From the above dependencies, I found that the candidate keys are {Patient_ID, Theatre_ID} {Patient_ID, Surgery_ID} and {Surgery_Record_ID, Patient_ID, Surgery_ID, Theatre_ID}

So does my table violate the Second Normal Form? Please help to check if my FDs are correct because i very new at doing this. Thanks a lot in advance

Was it helpful?

Solution

Your FDs are in boldface.


  • Patient_ID, Theatre_ID---> Surgery_Date

Based on the sample data, I'd have to say this one is wrong. The following FDs seem to be correct for these three attributes. They're derived mainly from your assumptions, which I've pointed out in comments probably don't hold in the real world.

  • Patient_ID -> {Theatre_ID, Surgery_Date}
  • Surgery_Date -> Theatre_ID

  • Surgery_Record_ID---> Patient_ID

Each row gets a different value for Surgery_Record_ID, so Surgery_Record_ID determines every attribute.

  • surgery_Record_ID -> {patient_ID, surgery_ID, theatre_ID, Surgery_Date}

  • Patient_ID---> Surgery_ID, Surgery_Record_ID, Theatre_ID

Since patients can't revisit, and since patients can have only one surgery, Patient_ID will be globally unique, just like Surgery_Record_ID. Patient_ID will determine every attribute.

  • patient_ID -> {surgery_Record_ID, surgery_ID, theatre_ID, Surgery_Date}

  • Patient_ID, Surgery_ID--->Theatre_ID

I covered Patient_ID above. Surgery_ID doesnt' determine anything.


  • Surgery_Record_ID, Patient_ID, Surgery_ID, Theatre_ID---> Surgery_Date

  • Surgery_Record_ID -> {Patient_ID, Surgery_Date}

  • Patient_ID -> {Surgery_Record_ID, Surgery_Date}
  • Surgery_Date -> {Surgery_Record_ID, Patient_ID}

Your assumptions require Surgery_Date to be unique. So Surgery_Date determines every attribute.

  • Surgery_Date -> {patient_ID, surgery_ID, theatre_ID, surgery_Record_ID}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top