By binnyva
via bin-co.com
Published: Jan 27 2008 / 17:46
Even though I am not a professional database administrator, I have designed a number of databases. One thing that always plagued me when doing this is the lack of a common convention that can be used to create the database design. So, I have decided to create one for myself. You may not agree with all the rules given here - feel free to copy this list and create a set of rules for yourself. But once it is created, make sure that you stick to it.
Comments
etm117 replied ago:
I have seen better SQL conventions, and much (much) worse ones. The OP admits the ones listed are not perfect, but is completely correct in the fact that some standards/conventions are better than none.
dragmire replied ago:
Mine are quite a bit different, but I agree that at least having a standard across the shop is better than 50 different implementations.
,
akitaonrails replied ago:
Better set: table names in downcase, underline separated, word. table name in plural. column names also downcase, underline separated. Foreign keys with the name of the foreign table in the singular appended with "_id". primary key always called "id". Some special column names as default, like 'created_at', 'updated_at', 'created_on', 'updated_on'. Many-to-many tables named after it's related table names, in plural, concatenated. Now this is a good set :-) (sorry, couldn't resist)
akitaonrails replied ago:
sorry, not 'downcase', I meant 'lowercase'
sigzero replied ago:
I would fire him if I saw all that crap.
Voters For This Link (8)
Voters Against This Link (8)