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 -> Re: Naming conventions?

Re: Naming conventions?

From: Norbert Vossiek <norbert.vossiek_at_gmx.li>
Date: Mon, 3 Jun 2002 18:05:33 +0200
Message-ID: <adg4cq$d9h$01$1@news.t-online.com>


True!

I like table synonyms much more.

SELECT a.id, b.id
FROM employee a, salary b
WHERE a.id = b.id

is easy to read and easy to write also if you deal with some 10+ tables.

Think of a employee-customer relationship. If you use Visio Ent. or the like, relationships and their respective columns propagate automatically, and what to do then? Rename it (lot of work and a nifty way to discover Visio errors...)?

Should I name the n:m table column emp_id? Or emp_cst_id? Or ecu_id? How to name the cus_id then? Or did you allready decide to brake the rule (only once, shure!) and to name this column cust_id (which I found in soooo many real world systems)?

BTW: Once upon a time Scott Adams (Dilbert) has pointed out a quite similar problem with project acronyms.

Norbert

"Dusan Bolek" <pagesflames_at_usa.net> schrieb im Newsbeitrag news:1e8276d6.0206022238.1424a049_at_posting.google.com...
> Marc Blum <marc_at_marcblum.de> wrote in message
news:<dd0lfuojcpk6crc3csg6pbcun3928huput_at_4ax.com>...
> > One convention we use and which helps a lot in writing understandable
SQL,
> > especially when you deal with a lot of joins, is:
> >
> > - Each table has a unique three character long abreviation (for example:
emp for
> > employee ;-)
>
> > - Foreign keys are the column_name in the parent table prefixed with the
child
> > table's prefix
>
> > CREATE TABLE employee
> > (emp_id NUMBER(35),
> > emp_dpt_id NUMBER(35),
> > emp_name VARCHAR2(4000),
> > emp_birthdate DATE,
> > emp_hiredate DATE)
> > /
>
> I hate this one. The problem with three character abreviation is that
> on all larger system you will very soon run out from *nice* ones and
> ending inevitably
> with something like D19. I do not think so that this "helps a lot in
> writing understandable SQL".
>
> --
> _________________________________________
>
> Dusan Bolek, Ing.
> Oracle team leader
>
> Note: pagesflames_at_usa.net has been cancelled due to changes (maybe we
> can call it an overture to bankruptcy) on that server. I'm still using
> this email to prevent SPAM. Maybe one day I will change it and have a
> proper mail even for news, but right now I can be reached by this
> email.
Received on Mon Jun 03 2002 - 11:05:33 CDT

Original text of this message

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