Results 1 to 3 of 3
  1. #1
    JonathanOz is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Location
    Santa Monica, CA USA
    Posts
    6

    Question Multiple Primary Keys

    This is kind of rudimentary, but I'll ask it anyway. I have a table where each record is unique if at least one of three variables is different. The three variables in my case are each integers and are:
    1. Year
    2. Route
    3. Segment.




    Now each of these individual variables allows (and has) duplicates, but if the thing is working right, no pair of records in this table should have all three of these variables with identical values. Is this table a candidate for using multiple primary keys?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Read through this tutorial for background on table design, normalization and Primary Key.

    http://www.rogersaccesslibrary.com/T...lationship.zip

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    My opinion: you would not have multiple primary keys (a table can have only one PK), but your primary key would be a compound key consisting of the three fields. Nothing wrong with that; it will prevent duplication, which is what you want to do. Just be aware that things might get a bit complicated if you want to use that table in relationships using that PK. Will you be doing so?

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Changing primary keys
    By ksammie01 in forum Database Design
    Replies: 4
    Last Post: 02-07-2013, 07:56 PM
  2. primary keys in four different tables
    By greatlhanderz_15 in forum Access
    Replies: 5
    Last Post: 01-30-2013, 10:04 PM
  3. Primary Keys & Relationships
    By Njliven in forum Programming
    Replies: 4
    Last Post: 12-17-2012, 09:42 AM
  4. How to create two primary keys
    By Shabana123 in forum Database Design
    Replies: 1
    Last Post: 09-08-2012, 05:55 AM
  5. Multiple primary keys
    By elektrisk in forum Access
    Replies: 5
    Last Post: 02-11-2010, 04:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums