Friday, February 5, 2016

SQL Style from Joe Celko

As a DBA at a small company, one of the things that I've had to do is establish naming standards for all things SQL and enforce them. The standard I chose was snake_case for all names of objects (lower case with an underscore between words). These naming standards get more detailed for how to name foreign key constraints, how to name indexes, tables, triggers and so on. Besides MySQL, I'm also a SQL Server DBA and I've found that some developers do not like my standards. My company has a dozen or so applications that we are actively developing and some of these are SQL Server projects. One of the managers for one of the SQL Server projects decided not to use my naming standards and instead to use his own. So now I am in the business of enforcing Pascal Casing for one project and the "company standards" for everything else. Pascal is similar to CamelCase.

I'd like to reference a little book that is now in the public domain called "Joe Celko's SQL Programming Style". I've seen it in the public domain but it can also be purchased online.

I agree to "Avoid the Use of CamelCase" from section 2.1.5. The book has lots of other great advice for naming things. This should probably be a required reading for all DBAs.

No comments:

Post a Comment