การนับและคะแนนและค่าเฉลี่ยสำหรับคำถามและคำตอบ ไม่จำเป็นต้องใช้ตารางทั้งหมด
Counts and Scores and Averages for Questions and Answers.It is not neccessary to use all the tables.
 Comments:  Id [ number]  PostId [ number]  Score [ number]  Text [ text]  CreationDate [ time]  UserDisplayName [ text]  UserId [ number]  ContentLicense [ text] 
SELECT OwnerUserId AS "user_link", question_count, question_score, (CASE WHEN question_count > 0 THEN (1.0 * question_score / question_count) ELSE 0 END) AS score_per_question, answer_count, answer_score, (CASE WHEN answer_count > 0 THEN (1.0 * answer_score / answer_count) ELSE 0 END) AS score_per_answer FROM (SELECT p.OwnerUserId, SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS question_count, SUM(CASE WHEN p.PostTypeId = 1 THEN p.Score ELSE 0 END) AS question_score, SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS answer_count, SUM(CASE WHEN p.PostTypeId = 2 THEN p.Score ELSE 0 END) AS answer_score FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY p.OwnerUserId) AS a