Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    24

    Question Unanswered: Database inheritance - not sure if i'm doing it correctly?

    Hello

    I have just designed a database with an inheritance relationship. I have supertype as a table on its own. Each subtype would also have a table too.

    i need to reference the supertype with the subtype.

    supertype table:
    - id (PK)
    - ..other fields

    each subtype table:
    - id (PK)
    - ..unique sub fields

    Should i make subtype id a FK as well as a PK so it can reference its parent supertype? OR should i introduce an additional field that does the referencing like:

    subtype table:
    - id (PK)
    - unique sub fields..
    - supertype_id (FK) which references the parent

    ??

    Also - should my subtype PK id be auto-increment?

    thanks in advance

  2. #2
    Join Date
    Nov 2009
    Posts
    24
    ah, nevee mind. i think i got it

Posting Permissions

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