instruction: Number Upvotes and Downvotes and acceptance ratio for a meta.stackexchange question.
response: SELECT Id AS "post_link", Votes, Upvotes, Downvotes, Upvotes * 1.0 / Votes FROM (SELECT p.Id, COUNT(CASE WHEN VoteTypeId = 2 THEN 1 END) AS "upvotes", COUNT(CASE WHEN VoteTypeId = 3 THEN 1 END) AS "downvotes", COUNT(CASE WHEN VoteTypeId = 2 OR VoteTypeId = 3 THEN 1 END) AS "votes" FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.ClosedDate IS NULL GROUP BY p.Id)