Reputaiton and Accepted Answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

SELECT
    u.Reputation,
    COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS AcceptedAnswers,
    COUNT(*) AS TotalAnswers,
    CAST(COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS FLOAT) / COUNT(*) AS AcceptanceRate
FROM
    Posts p
JOIN
    Users u ON p.OwnerUserId = u.Id
JOIN
    Posts q ON p.ParentId = q.Id
WHERE
    p.PostTypeId = 2 -- 2 for Answers
GROUP BY
    u.Reputation
ORDER BY
    u.Reputation;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results