I'd like to determine the average number of upvotes and downvotes for all my questions and answers. Are there any database commands to do this?
The usual SEDE disclaimers apply here:
- It only updates once a week (usually Sunday morning, depending on your timezone), so it won't include any questions or answers posted in the last few days
- Deleted questions and answers are not included
Here are mine:
Average question score is 15.63, with an average of 15.81 upvotes and 0.19 downvotes per question.
Average answer score is 15.44, with an average of 15.48 upvotes and 0.04 downvotes per answer.
Average question score is 10.76, with an average of 11.66 upvotes and 0.9 downvotes per question.
Average answer score is 6.84, with an average of 6.9 upvotes and 0.07 downvotes per answer.
Sure. Nice one-liner to paste into the Data Explorer:
SELECT AVG(Score) AS [Average Score] FROM Posts WHERE OwnerUserId = ##UserId:int##
Provides an average score across all posts. If you want to filter to post types, you'll need to add another constraint.
N.B. Will always output an integer, because of integer division. Can be worked around, if necessary.