I could see this being the intimidating section of the post where people bounce off. I would either remove the full query and just do the step-by-step explanation (or move the full query after the step-by-step), or I would let them know that a step-by-step explanation follows this gigantic block of code.