Posts

Showing posts from August, 2022

How to Make SQL Easier to Understand, Test and Maintain , by Chris Saxon

Image
  We all know that SQL helps us build better applications by giving us an efficient way to store, manipulate and retrieve data from databases. But we’ve also seen SQL statements hundreds of lines long that are practically impossible to test and debug. Don’t let these put you off SQL. By modularizing the code, you can make SQL easier to understand, easier to test, easier to update and simply better. Chris Saxon Chris is a developer advocate for Oracle Database, where his job is to help you get the best out of it and have fun with SQL. You can find him on Twitter, @ChrisRSaxon, and on his blog, All Things SQL. Modularization pulls out bits of code that appear often in SQL statements and turns them into reusable components. Whenever you need to use those bits of code, you simply access the module. If a bug appears in a code module, you can readily identify it — and fix it in one place. This also applies if you find a better way to code a module. You can improve it once and the entire SQL