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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Design question...

RE: Design question...

From: Mercadante, Thomas F <NDATFM_at_labor.state.ny.us>
Date: Wed, 17 Apr 2002 10:20:56 -0800
Message-ID: <F001.00446E18.20020417102056@fatcity.com>


Chris,

I would prefer the first method. As far as I am concerned, the only reason to use a sequence number as a primary key is if the value for the natural primary could could possibly change.

In this case, the two char state codes have been around for a very long time and would probably not change.

The other think I would be concerned with is considering Canadian Province codes. Would they fit within a "STATES" table structure?

This crazy world of ours is getting soooooo small, that thinking provincially about state codes may no longer be correct anymore.

hope this helps.

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
Sent: Wednesday, April 17, 2002 1:19 PM
To: Multiple recipients of list ORACLE-L

To simplify my question, if I am creating a STATE table to hold all the states of the US, should I create it like this...

Name                                      Null?    Type
----------------------------------------- --------
----------------------------
STATE_CODE                                NOT NULL CHAR(2)         <-- PK

STATE_DESC                                NOT NULL VARCHAR2(50)

or like this...

Name                                      Null?    Type
----------------------------------------- --------
----------------------------
STATE_ID                                  NOT NULL NUMBER          <-- PK 
STATE_CODE                                NOT NULL CHAR(2)
STATE_DESC                                NOT NULL VARCHAR2(50)

I'm trying to figure out which is more efficient, STATE_CODE or STATE_ID, when doing a PK lookup, dealing with FKs, etc.

Many TIA!!!

Chris
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Grabowy, Chris
  INET: cgrabowy_at_fcg.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Apr 17 2002 - 13:20:56 CDT

Original text of this message

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