Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> db design quest

db design quest

From: ed zappulla <zappullae_at_rcn.com>
Date: Tue, 1 Jun 1999 07:44:44 -0400
Message-ID: <7j0h3g$97l$1@autumn.news.rcn.net>


Hi, I'm looking for adivice/oppions about a db design issue. I'm using Oracle 8.0.5.

With regard to referece type tables, is it better to store relationships based upon an integer or is it ok to use a varchar as the primary key.

My philposiphy has been to use an integer for all inter table relationships. But its a pain when it comes to refernce type tables. I've keept with the paradigm but I'm reviewing my methodology for a new project.

example:

Assume there's a reference table credit_card_type (id int , code varchar2(4) , descp varchar2(30)) with PK id and values such as:

    1, AMEX, AMERICAN EXPRESS
    2,VISA, VISA
    3,MC, MASTER CARD

And a refrenceing table foo(....credit_card_type_id int...) with a constraint that credit_card_type_id refrences credit_card_type(id).

Is this better than this using the code as the foreing key:

credit_card_type (code varchar2(4) , descp varchar2(30)) with PK code and

    AMEX, AMERICAN EXPRESS
    VISA, VISA
    MC, MASTER CARD foo(....credit_card_type int...) with a constraint that credit_card_type refrences credit_card_type(code).

...Ed Received on Tue Jun 01 1999 - 06:44:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US