Re: column prefixes

From: Keith Boulton <boulkenospam_at_globalnet.co.uk>
Date: 1998/02/28
Message-ID: <34f7e741.2635554_at_read.news.global.net.uk>#1/1


On Fri, 20 Feb 1998 13:44:04 -0600, suhasu_at_hotmail.com wrote:

>EMPLOYEE Table
>em_employee_code (code of the employee)
>em_employee_name (name of the employee)
>em_dept_code (department code for the employee)
>em_create_date (timestamp)
>
>DEPARTMENT Table
>de_dept_code (code for department)
>de_dept_name (name for department)
>de_create_date (timestamp)
>

This results in unique column names in the database which means in simple queries you never need to include the table name in where clauses.

Personally I think it intrudes into the meaning of the column, because you must mentally discount the first few characters of the name.

It also leads to redundant naming as in your example above, em_employee_code is surely better replaced with em_code.

My own preference is not to use this sort of prefix, but always to use table name in queries. I do include a table prefix in foreign keys so the above would become

EMPLOYEE Table
  code (code of the employee)
  name (name of the employee)

  dept_code        (department code for the employee)
  create_date      (timestamp)

DEPARTMENT Table
  code        (code for department)
  name        (name for department)
  create_date      (timestamp)

I don't thing it matters too much, except that all the tables within an application should be consistent in naming. Received on Sat Feb 28 1998 - 00:00:00 CET

Original text of this message