The Art of SQL Report Writing

Part 1 of 5


Today we live in a data driven society. There is data everywhere and it can be more easily collected and processed than ever. Businesses rely on this data to make good decisions. Researchers use data to better understand what they are working on. There are all sorts of uses, but at the end of the day the two most critical things are 1. collection of the data and 2. creating views into that data so we can better understand what is going on.

In order to have clean and reliable data, it is important to design out your data independently to how you intend to report on it. This means your final reports may look nothing like the data format of the data you collected. As such, creating your reports can be rather challenging. It is for this reason companies spend some considerable time and money writing reports.

This article is intended to help report developers by providing some tips on how to construct their database queries quickly and easily. Of course, the information provided here will get you easily through about 80% of the reports needed but it will also give you a way to begin to tackle the most challenging 20% that remains and may even give you your first stab at those more complicated reports. At the very least it will help you construct easy to follow and read reports which will take much less time to debug, enhance, reuse and document.