Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2011

    How do I quickly find all possible Candidate keys in this case?

    subCode | staffName | Address | staffNo | classDay | classTime | YearSem | classRoom | Credit | subName
    __________________________________________________ ____________________________________
    | | | | | | | | |

    Business Rules:
    1. A lecture for acourse is meant for all the students enrolled in that unit in a particular semester.
    2. An lectuerer/instructor may teach more than one course in a semester but a course in a semester will
    be taught by only one lecturer.
    3. A course can have two lectures on the same day but at different times
    4. One course is taught by only one lecturer/instructor during one semester
    5. Different Instructors may teach the same unit in different semesters
    6. Course Name (3 letters) of the unit may not be unique for a unit
    7. Two Instructors may share the same office

    In this case, I tried to try every possibility but it is very time-consuming... how do I quickly find out all
    possible CKs? I can find out one CK (just random guess and then if that makes sense then judge whether any subset of that CK is not a CK) but if I do like this I might miss at least one possible CK... what should I do while doing it efficiently as well as accurately? thank you... MASTERS...

  2. #2
    Join Date
    Sep 2011

    I guess {classRoom, classDay, classTime, yearSem}

    can be a CK in this case?

  3. #3
    Join Date
    Jun 2003
    I wrote a script for doing this with actual data sets, but it is insanely complex and I'm certain far beyond what your lecturer would assign.
    I'm sure you are meant to deduce the candidate keys from the business rules supplied, not be examining the actual data.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

  4. #4
    Join Date
    Sep 2011

    Since you said so.

    I think what I can only do is to refer the CKs from the business rules!


    SO far I have found out 2 CKs but I am sure there will be at least 3 Cks for this assignment! thanks!

Posting Permissions

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