Results 1 to 5 of 5

Thread: Primary key

  1. #1
    Join Date
    Feb 2008
    Posts
    2

    Unanswered: Primary key

    hi...wanna ask about primary key.i have 4 fields which are species, date, station and cellcount for my database.which one should i use as primary key.please help me.

  2. #2
    Join Date
    Feb 2008
    Posts
    5
    Primary keys are generally an attribute of the record that is unique to the record - something that is never repeated in any other record. I am not sure any of the fields you've named would be unique. Perhaps some sort of autoincrementing field could be used?

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Species MIGHT be the PKF, but without the context it's impossible to say. I doubt it is tbh. What is the name of the table? What does the table contain... if it is something like a medical SAMPLE, then I'd suggest making a SampleID field that is set to Autonumber.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by bluemoonbird
    i have 4 fields which are species, date, station and cellcount for my database. which one should i use as primary key.
    primary key: ( species, date, station )

    data field: cellcount
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2008
    Posts
    2

    primary key

    actually, i'm going to build an algae database. it's an algae table

Posting Permissions

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