May 2018
Intermediate to advanced
576 pages
30h 25m
English
First, verify that you really have a complex query.
A query that simply returns lots of database fields is not complex by itself. In order to be complex, the query has to join lots of tables in complex ways.
The easiest way to find out whether the query is complex is to look at the output of EXPLAIN. If it has lots of rows, the query is complex, and it's not just that there is a lot of text.
All examples in this recipe have been written with a very typical use case in mind: sales.
What follows is a description of the fictitious model used in this recipe. The most important fact is the sale event, stored in the sale table (I specifically used the word fact, as this is the right term to use in a data warehousing context). Every ...