Back to problems

Average Reactions per Post

SQL · Meta · Medium

We have two tables that capture posts and the interactions they receive. Table: post post_id is the primary key. The relationship column tells you whether the post was shown to a friend or to an unconnected user; it holds either 'friend' or 'unconnected'. Table: interaction A post can appear in multiple rows here—each row represents one reaction (like, comment, etc.). Task: For all posts created within the last 7 days, calculate the average number of reactions per post,…

Checking your access…