Plots quartiles of the answer score distribution as a function of answer length.
Q&A about the site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure
WITH AllQuartiles(RoundedLength,PostScore,Quartile) AS ( SELECT TOP(1000000) ROUND(LEN(Body), -2) AS RoundedLength, Score AS PostScore, NTILE(4) OVER(PARTITION BY ROUND(LEN(Body), -2) ORDER BY Score) AS Quartile FROM Posts WHERE PostTypeId = 2 AND LEN(Body) <= 10000 ORDER BY ROUND(LEN(Body), -2),Score ) SELECT RoundedLength,MAX(PostScore) FROM AllQuartiles WHERE Quartile!=4 GROUP BY Quartile,RoundedLength ORDER BY RoundedLength,Quartile