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: Column name

Re: Column name

From: Jared Still <jkstill_at_cybcon.com>
Date: Fri, 27 Apr 2001 13:51:46 -0700
Message-ID: <F001.002F49DD.20010427135048@fatcity.com>

I'd side with Stephan on this. Many folks think it necessary to preface foreign key columns with the short name of the parent table.column.

Most of the time this is redundant. There are situations where it is necessary though:

  1. inheriting 2 columns of the same name from different tables. e.g. inheriting both item.sale_date and order.sale_date It's advisable to have something like item_sale_date and ord_sale_date in a case like this.
  2. You already have a column of the same name in the child table.
  3. other examples?

Jared

On Friday 27 April 2001 04:36, paquette stephane wrote:
> Yes you can use the same column name in a database and
> in a schema. The only thing is that you have to
> precede the field with the table name when you're
> joining 2 tables containing columns with the same
> name.
>
> Let's open a can of worm.
>
> There are 2 stands on this :
> 1. Something should have the same name everywhere in
> the DB. For example, product_id should be product_id
> in the product table and in the monthly sales table.
>
> 2. Each column should be prefix by the table
> abbreviation so in the product table it is
> prd_product_id and in the monthly sales table
> something like mthlysl_product_id.
>
> Personnaly, I prefer the first one.
>
>
>
> --- Roland.Skoldblom_at_ica.se a écrit : > Can I use the
> same column name in the same database
>
> > and in the same schema? Could this cause me lots of
> > trouble?
> >
> > Roland Sköldblom
> >
> > --
> > Please see the official ORACLE-L FAQ:
> > http://www.orafaq.com
> > --
> > Author:
> > INET: Roland.Skoldblom_at_ica.se
> >
> > 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).
>
> =====
> Stéphane Paquette
> DBA Oracle, consultant entrepôt de données
> Oracle DBA, datawarehouse consultant
> stephane_paquette_at_yahoo.com
>
> ___________________________________________________________
> Do You Yahoo!? -- Pour faire vos courses sur le Net,
> Yahoo! Shopping : http://fr.shopping.yahoo.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jared Still
  INET: jkstill_at_cybcon.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).
Received on Fri Apr 27 2001 - 15:51:46 CDT

Original text of this message

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