Link Details

Link 62751 thumbnail
User 202995 avatar

By o_j_t
via databasedev.co.uk
Published: Jan 24 2008 / 15:00

Database developers have historically used a somewhat cryptic system for naming database tables and fields. Originally a result of the limitations of database management systems (DBMS), these naming schemes - or the lack thereof - have become adopted by convention and tradition. However, as database applications become more complex, with more tables and larger teams of developers, and as developers come and go, it becomes much more important to implement a robust and disciplined naming scheme for database objects. A well-defined naming scheme becomes more important when you adopt object relational mapping (ORM) technologies or automatic code generation This article presents one scheme that has worked for me for years in multiple successful commercial applications.
  • 7
  • 4
  • 1336
  • 602

Comments

Add your comment
User 107114 avatar

daniel replied ago:

0 votes Vote down Vote up Reply

IMHO it's a bad scheme, but the article is still an interesting read.

User 209577 avatar

LudoA replied ago:

0 votes Vote down Vote up Reply

Why do you find it a bad scheme (just curious)?

User 107114 avatar

daniel replied ago:

1 votes Vote down Vote up Reply

Two reasons: prefixes and dissimilar primary key fields. Prefixes just annoy me mainly because they rarely communicate something we don't already know (I *know* it's a table, I don't need to type three extra chars each time to remind myself). Also, they make employing ORMs more interesting. Not difficult per se (any decent ORM will handle arbitrary table name conventions with ease), but atypical.

The primary key think is a taste issue really. I like all my primary keys to be the same name (I usually like "id"). That way I know what the key is without ever having to look at the schema, I can just type away and formulate a query without thinking. I'm not really opposed to other field conventions though, as long as they don't include prefixes. :-)

User 186462 avatar

Jeremy Weiskotten replied ago:

0 votes Vote down Vote up Reply

I agree... this is pretty painful.

User 210175 avatar

jtheory replied ago:

0 votes Vote down Vote up Reply

I had pretty much the same reaction -- he's clearly put some thought into this, but I disagree with almost all of his conclusions. I'm writing a blog post of my own to respond in depth.

User 210175 avatar

jtheory replied ago:

1 votes Vote down Vote up Reply
User 236137 avatar

dzonelurker replied ago:

0 votes Vote down Vote up Reply

ISO/IEC 11179-5

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.

Voters For This Link (7)



Voters Against This Link (4)