Plots quartiles of the answer score distribution as a function of answer length.
Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language
WITH AllQuartiles(RoundedLength,PostScore,Quartile) AS ( SELECT TOP(##postsNo?100000##) (ROUND(LEN(Body), -##logRound?3##) +0.5E##logRound?3##) AS RoundedLength, Score AS PostScore, NTILE(4) OVER(PARTITION BY ROUND(LEN(Body), -##logRound?3##) ORDER BY Score) AS Quartile FROM Posts WHERE PostTypeId = 2 AND LEN(Body) <= ##maxLength?20000## ORDER BY ROUND(LEN(Body), -##logRound?3##),Score ) SELECT RoundedLength, MAX(CASE Quartile WHEN 1 THEN PostScore END) '1', MAX(CASE Quartile WHEN 2 THEN PostScore END) '2', MAX(CASE Quartile WHEN 3 THEN PostScore END) '3', MAX(CASE Quartile WHEN 4 THEN PostScore END) '4' FROM AllQuartiles --WHERE --Quartile!=4 GROUP BY RoundedLength ORDER BY RoundedLength