DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Referential Integrity

  1. #1
    Join Date
    Nov 2001
    Location
    Atlanta GA
    Posts
    45

    Referential Integrity

    Can a DB table have a foreign key and not a primary key? I have a key in one table that references a primary key in another table.

  2. #2
    Join Date
    Nov 2001
    Location
    Atlanta GA
    Posts
    45

    More Referential Integrity

    Also can you have a primary key that references a primary key in another table?

    Thank you

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    A foreign key can only exist if there is a primary key to reference. The PK referenced by the FK can be on a different table (as is usually the case), but could be on the same table as the FK (so the table is "self-referential").

    A table does not need to have a PK in order to have FK's (this is often the case with data warehouse fact tables).

    A PK does not reference another PK -- PK's don't reference other contrainsts at all, in the way that FK's do.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

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


Click Here to Expand Forum to Full Width