เปอร์เซ็นต์สถานะของคำถามที่ถามในแต่ละสัปดาห์ ไม่จำเป็นต้องใช้ตารางทั้งหมด
Status Percentages of Questions Asked Each Week.It is not neccessary to use all the tables.
 PostHistory:  Id [ number]  PostHistoryTypeId [ number]  PostId [ number]  RevisionGUID [ other]  CreationDate [ time]  UserId [ number]  UserDisplayName [ text]  Comment [ text]  Text [ text]  ContentLicense [ text] 
WITH questiontypeweek AS (SELECT Id, DATEDIFF(wk, CreationDate, GETDATE()) AS week, (CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE (CASE WHEN ClosedDate IS NULL THEN 2 ELSE 3 END) END) AS type FROM Posts AS p WHERE PostTypeId = 1) SELECT a.week, a.accepted, b.closed, c."open" FROM (SELECT COUNT(*) AS accepted, week FROM questiontypeweek WHERE type = 1 GROUP BY week) AS a JOIN (SELECT COUNT(*) AS closed, week FROM questiontypeweek WHERE type = 2 GROUP BY week) AS b ON a.week = b.week JOIN (SELECT COUNT(*) AS "open", week FROM questiontypeweek WHERE type = 3 GROUP BY week) AS c ON a.week = c.week ORDER BY a.week