From: Karsten D. <k.d...@tu...> - 2001-03-27 10:51:25
|
On Tue, Mar 27, 2001 at 10:40:51AM +0200, Alain Fontaine wrote: > Database field naming: I have adopted the following naming convention, wh= ich > seems to be quite appreciated by anyone who is working with my code: > * Primary keys : <tablename in singular>ID. Example: Banners table: > BannerID. Hosts table: HostID. Users table: UserID. > * Foreign keys (which are basically references) : ref<primary key name of > other table>. Like: refBannerID, refHostID, refUserID. > This naming makes it very easy for everyone to see what is going on. Why = not > simply name primary keys as "id" ? Because you will end up having to type > <table name><dot>id quite often if you have joins over several tables, an= d I > personally think it's more confusing to have 15 "id" field names than > BannerID, HostID, UserID. Just my personal idea, though. I think this makes sense. Probably I am going to use it for my own projects... may I? :-) Karsten --=20 Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. ----------------------------- mailto:k.d...@tu... w=B3: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg |