โหวตขึ้นและลงตามวันในสัปดาห์ของคำตอบที่ยอมรับ ไม่จำเป็นต้องใช้ตารางทั้งหมด
Up vs Down votes by day of week of Accepted Answer.It is not neccessary to use all the tables.
 PostHistoryTypes:  Id [ number]  Name [ text] 
SELECT TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') AS Day, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT)) AS UpVoteDownVoteRatio FROM Votes AS v JOIN Posts AS p ON v.PostId = p.AcceptedAnswerId WHERE PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL AND VoteTypeId IN (2, 3) GROUP BY TIME_TO_STR(p.CreationDate, 'WEEKDA%Y'), TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') ORDER BY TIME_TO_STR(p.CreationDate, 'WEEKDA%Y')