Chapter 2. Data Manipulation Guidelines

 <  Day Day Up  >  

IN THIS CHAPTER

  • A Bag of Tricks

  • SQL Access Guidelines

  • Complex SQL Guidelines

  • Common Table Expressions and Recursion

  • Working with NULLs

  • Date and Time Guidelines

  • Data Modification Guidelines

In Chapter 1, "The Magic Words," you learned the basics of SQL, but you can gain a deeper body of knowledge on the proper way to code SQL statements. Any particular method of coding an SQL statement is not wrong, per se, as long as it returns the correct results. But, often, you can find a better way. By better , I mean

  • SQL that understands and interacts appropriately with its environment

  • SQL that executes more efficiently and therefore enhances performance

  • SQL that is clearly documented and therefore easily understood

You should pursue each of these goals. The guidelines introduced in the following sections are based on these three goals. These guidelines enable you to write efficient SQL and thereby limit the time programmers, analysts, and DBAs must spend correcting performance problems and analyzing poorly documented SQL and application code.

 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net