Interview Query

Community Heath Metrics

Have you seen this question before?

You work at Stack Overflow on the community team that monitors the health of the platform.

Community members can create a post to ask a question, and other users can reply with answers or comments to that question. The community can express their support for the post by upvoting or downvoting.



post_analytics table

Column Type Description
id INTEGER Primary key of posts table
user_id INTEGER ID of the user who created the post
created_at DATETIME Timestamp of the post
title VARCHAR Title of the post
body VARCHAR Text content of the post
comment_count INTEGER Total number of the comments on a post
view_count INTEGER Total number of the views on a post
answer_count INTEGER Total number of answers on a post
upvotes INTEGER Total number of upvotes on the post
  1. Given a table of Stack Overflow posts data, suggest three metrics to monitor the health of the community.

  2. Write the queries for these metrics in SQL.

Next question: Impute Median
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query