Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Posts
    3

    Unanswered: how many primary keys fields?

    Hi,
    I am working on a database design. The problem is that the structure of the information is hierarchal, which means the primary keys from the upper level is always a part of the primary key of below levels making it incremental composite primary key.

    Eg.
    Table A
    ---------
    VARCHAR(5) SHOP_ID (PK)
    VARCHAR(50) NAME

    PK: SHOP_ID


    Table B
    ---------
    VARCHAR(5) SHOP_ID (FK)
    VARCHAR(5) MENU_ID (PK)
    VARCHAR(50) TITLE

    PK: SHOP_ID & MENU_ID

    TABLE C
    ----------
    VARCHAR(5) SHOP_ID (FK)
    VARCHAR(5) MENU_ID (FK)
    VARCHAR(5) ITEM_ID (PK)

    PK: SHOP_ID & MENU_ID & ITEM_ID

    and so on....

    I end up having 7 fields of compostite primary key in the lower most table in the hierarchy.

    What do I do?
    1) Show I use all the fields as a composite primary key?
    2) Make Auto Increment as a primary key and all other foreign keys as indexes?
    3) Any other solution?

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189

    Oracle LDAP

    Hello,

    what do you think about the Oracle LDAP solution. It is much easier to build hierarchaly structure with a LDAP protocol than in a relational database.
    You can also use PL/SQL to access datas from an "normal" relational Oracle DB to an Oracle LDAP and vice versa.

    I think this is the only way to design hierachic structures ... otherwise you will get in trouble with performance ....

    Hope that helps ?

    Regards
    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Jul 2002
    Posts
    3

    Don't have LDAP!

    I wish I had LDAP! I don't have LDAP. I can only work with rational databaes.

    Thank you for your reply.

Posting Permissions

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