List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:May 21 2012 12:27pm
Subject:Re: create alias for columns bound to database?
View as plain text  
----- Original Message -----
> From: "Rick James" <rjames@stripped>
> 
> * should not begin with the table name

Personally, I tend to prefix all column names with three-letter abbreviations of the table
name, so that they are both unique across joins, and it's obvious what table they're from
wherever they appear.

> * ids should be spelled the same between tables (`foo_id` both where
> it is the PK, and where it is a FK)

Yeps, and together with the above convention it is also immediately clear what table that
key links to.

Beyond that, make names descriptive. Don't use field_1, field_2 and field_3; call them
name, age and gender.

-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
create alias for columns bound to database?D. Dante Lorenso18 May
  • RE: create alias for columns bound to database?David Lerer18 May
  • RE: create alias for columns bound to database?Rick James18 May
    • Re: create alias for columns bound to database?Johan De Meersman21 May
      • RE: create alias for columns bound to database?Rick James21 May