ฉันจะได้รับคะแนนโหวตเฉลี่ยกี่คำตอบสำหรับแต่ละแท็ก ไม่จำเป็นต้องใช้ตารางทั้งหมด
How many answer upvotes will I get in average for each tag?.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] 
SELECT TagName, CAST(COUNT(Votes.Id) AS FLOAT) / COUNT(DISTINCT Posts.Id) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.PostTypeId = 2 GROUP BY TagName AND CAST(COUNT(Votes.Id) AS FLOAT) / COUNT(DISTINCT Posts.Id) > 1 ORDER BY UpVotes DESC