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.
  • Table- and column names must be quote encapsulated.
  • 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