Q&A for speakers of other languages learning English
with a as ( select pa.Score, pq.CreationDate as question_date, pa.CreationDate as answer_date, DATEDIFF(day, pq.CreationDate, pa.CreationDate) daydiff from Posts pa join Posts pq on pa.ParentId = pq.Id ) select daydiff, avg(1.00*Score) quality from a where daydiff >=0 and daydiff < 50 group by daydiff order by daydiff