SQL is at the core of Business Intelligence reporting. Let’s say we want to find the percent change in market share for a grouping of products. We will compare a current three month period to the same period in the previous year. This share calculation is also logically similar to that needed to make the same comparison to competitors if that data were available.

We will use the WITH clause and nested inline views.