Link Details

Link 63283 thumbnail
User 212072 avatar

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.
  • 8
  • 8
  • 1801
  • 669

Comments

Add your comment
User 245788 avatar

etm117 replied ago:

0 votes Vote down Vote up Reply

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.

User 256617 avatar

dragmire replied ago:

0 votes Vote down Vote up Reply

Mine are quite a bit different, but I agree that at least having a standard across the shop is better than 50 different implementations.
,

User 261531 avatar

akitaonrails replied ago:

0 votes Vote down Vote up Reply

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)

User 261531 avatar

akitaonrails replied ago:

0 votes Vote down Vote up Reply

sorry, not 'downcase', I meant 'lowercase'

User 60609 avatar

sigzero replied ago:

0 votes Vote down Vote up Reply

I would fire him if I saw all that crap.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.