Sample chapter: Exotic Operators in SQL
February 8, 2007
The core of SQL language is fairly compact. Select-project-join, set operators, nested subqueries, inner views, aggregation – make up a very short but expressive list of operators. This is all that most users ever need for everyday usage. Once in a while, however, there comes a problem that can’t be solved by these means. Often, such a problem is evidence of a missing language feature.
User-defined aggregates and Pivot, which we study in the beginning of this chapter, are undoubtedly on top the list of the desired features. Next, Symmetric Difference and Logarithmic Histograms are two more query patterns that every developer sooner or later must encounter in their practice. Then, either Relational Division, or Skyline comes perhaps once in a lifetime. And, finally, the Outer Union is so rare, that there is almost no chance an (ordinary) developer would ever need it. Yet, we’ll get a chance to leverage it in the next chapter.