instruction: Rep collected by questions and answers. It counts only accept/up/down votes on not deleted posts. PostTypeId = 1 means a question. PostTypeId = 2 means an answer.
response: SELECT SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 15 WHEN Votes.VoteTypeId = 3 THEN -2 WHEN Posts.PostTypeId = 1 THEN 5 ELSE 10 END) AS Rep, Posts.PostTypeId FROM Posts, Votes WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId <= 3 AND Posts.PostTypeId <= 2 GROUP BY Posts.PostTypeId