Skip to content

Code Style Guide: SQL

CVi edited this page Sep 13, 2010 · 5 revisions

General
To improve readability of the SQL code these guidelines are used:

  • All SQL should have SQL keywords in Caps.
  • Never ever use backticks, if you need to use them, there is a design problem somewhere, try fixing that instead.
  • when specifying a alias for a column or table name, use the AS keyword.
    Correct:
    SELECT n.name AS myname FROM names AS n
    Incorrect:
    select n.name myname from names n

Clone this wiki locally