Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009

    Unanswered: Choosing the right primary key

    I am kind of new at this. I have to implement this table in an oracle db, but I'm stuck on finding the correct primary key.

    I believe Repair Id and Mechanic Id will satisfy the PK. But does Equipment Id have to be included?

    Attached Thumbnails Attached Thumbnails pk.jpg  

  2. #2
    Join Date
    Dec 2007
    We can't really tell with the amount of info supplied. For example, if a car gets 'repaired' but that repair doesn't resolve the issue and the car comes back another day, does it get the same Repair ID, what if the same equipment is used, what if it comes back on the same day? You need to assess what will happen to the data over time. Personally, I would be looking at a surrogate key for this.

  3. #3
    Join Date
    Mar 2007
    As pablolee said, without knowing the meaning of every column, every suggestion would be (more or less precise) guess.
    Anyway, before implementing anything, I would suggest you to read about database normalization and create proper data model. At least, columns 1-2, 4-7 and 8-10 look like candidates for normalization to second normal form. But, I may be wrong as I do not know their real meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts