Subject | Re: [firebird-support] How do you name your foreign key column? |
---|---|
Author | Mark Rotteveel |
Post date | 2014-12-18T20:02:50Z |
On 18-12-2014 15:59, brucedickinson@... [firebird-support] wrote:
name in the source and target table (when possible and logical) also
allows you to use the USING clause in a join, and keeps columns readable
even if you alias the table to something short.
However naming conventions are a matter of opinion. In general within a
team or company decide on one naming convention and stick to it (within
reason).
Mark
--
Mark Rotteveel
> Hi guys,I usually use <table>_ID for primary *and* foreign key. Using the same
>
> in our database I see two naming conventions for foreign key columns:
>
> 1.
> <SOMETHING>_ID
>
> 2.
> ID_<SOMETHING>
>
> which one do you use and why?
>
> I see that in system tables the first convention is used (f.e.
> MON$TRANSACTION_ID, MON$ATTACHMENT_ID)
>
> Thanks for your opinion.
name in the source and target table (when possible and logical) also
allows you to use the USING clause in a join, and keeps columns readable
even if you alias the table to something short.
However naming conventions are a matter of opinion. In general within a
team or company decide on one naming convention and stick to it (within
reason).
Mark
--
Mark Rotteveel