Well Formed SQL Statements

From database24
Revision as of 00:06, 26 April 2010 by Dec (talk | contribs) (Created page with '== General == SQL statements can be read much easier, if they are well-formatted. Good formatting is achieved as follows: * align the SQL keywords to the right * make use of fi...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

General

SQL statements can be read much easier, if they are well-formatted.

Good formatting is achieved as follows:

  • align the SQL keywords to the right
  • make use of field and table aliases
  • use only one field per line
  • align operators to the right
  • align values to the left

Examples

SELECT

INSERT

UPDATE

DELETE