Creating Efficient SQL
Structured Query Language is like any other programming language in that it can be coded well, coded poorly, and everywhere in between. Learning to create efficient SQL statements has been discussed in countless books. This chapter zeroes in on basic SQL coding fundamentals and addresses some techniques to improve performance of your SQL statements. In addition, some emphasis is given to ramifications of poorly written SQL, along with a few common pitfalls to avoid in your SQL statements within your application. Most database performance issues are caused by poorly written SQL statements. Therefore, this chapter focuses on SQL fundamentals, which leads to better performing SQL, which leads to a more efficient use of database resources and overall better database performance. In addition, this can be extended to fundamental SQL code design as part of an overall software development lifecycle (SDLC) process. Good, fundamental code is also easy to read and therefore easier to maintain. This improves the performance of the overall SDLC process within an organization.