Results 1 to 2 of 2
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Composite Primary Key VS Foreign Key

    Hello,



    If we have in a entity call A that has the following Composite primary key,
    d, p

    And have another entity B that has the following composite primary key,
    d, p

    Foreign key for entity A and B is
    d, and also p
    Example,
    Entity Foreign Key
    A. d
    A. p
    B. d
    B. p

    Correct or No, please advise ?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Please provide more info.
    If you have EntityA with PK d,p, and
    EntityB with PK d,p--- my thought is that EntityA and EntityB are the same Subject.

    If you have tables with composite PK, and those tables are related via a junction table(s), you could end up with complex composite PK in the junction table(s).

    Often designers will use a surrogate unique (autonumber) PK for the junction and make a unique composite index of the original composite keys to prevent duplicates.

    Perhaps you could provide more info and sample data so readers could offer more focused responses.

    Good luck.

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

Similar Threads

  1. Replies: 4
    Last Post: 08-10-2017, 12:56 AM
  2. Replies: 20
    Last Post: 01-09-2017, 12:08 AM
  3. Primary key/ foreign key question
    By DaveG in forum Access
    Replies: 5
    Last Post: 05-02-2014, 12:42 PM
  4. Replies: 1
    Last Post: 05-24-2012, 09:35 AM
  5. primary/foreign keys
    By st1300 in forum Database Design
    Replies: 38
    Last Post: 12-04-2011, 01:27 PM

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