Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    5

    Functional dependencies and Primary Key

    Hello everyone,
    I have a problem regarding functional dependencies and selecting a primary key. Any help would be greatly appreciated. My question is:

    1. If we have a table in unnormalized form, what sequence of steps should we follow to determine the functional dependencies and primary key.

    a. Should we first determine the primary key and after that, determine the functional dependencies? OR

    b. Should we first determine the functional dependencies in the table and after that, select the primary key?

    Regards

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i would start with b.

    but it's pretty hard to say that definitively

    after all, i can't see your table
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2008
    Posts
    5
    Thanks for the reply. I tried and strangely enough found it easier to select the primary key first and then find out the functional dependencies. But I think selecting the functional dependencies first may also be correct.

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Why should one of those methods be correct and the other not? Either way you can achieve the same, correct result, so it is just a matter of which one works best for you isn't it?

    OTOH, if this is an exam question, then the correct answer must be (b) I guess, since to select a valid primary key requires that you know something is functionally dependent on it. When you start by selecting the primary key you are really doing so based on an intuitive knowledge of functional dependencies - so in fact you did start with the FDs.

Posting Permissions

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