This week's SQL article is a collection of tips and techniques for writing SQL.


The tips are divided into these categories:

  • Syntax
  • More Syntax
  • Performance
  • Design

The syntax tips cover reserved words, NULLs, strings, parentheses, and IN lists. You'll also learn what's wrong with "select star", why JOIN syntax is better, and when to write RIGHT OUTER JOINs (hint: never).

The performance tips barely scratch the surface (database performance is a career unto itself), but they include the importance of indexes and how to make sure you don't sabotage your own indexes.

The design tips include advice about first normal form, using simple datatypes, and autonumbers.

If you like these tips (or not), if you want to see more, or if you have any feedback on them at all, please post a comment in the discussion forum for this article.