SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Average Shares per Post

Unsolved

Meta wants to know how shareable each user's content is. For every user who has published at least one post, compute the total number of shares their posts received divided by their number of posts. Posts that were never shared still count in the denominator, and a user whose posts were never shared gets 0. Write an SQL query that returns user_id and avg_shares_per_post rounded to 2 decimal places. Order the results by user_id ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Meta

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM posts
Full source dataset
6 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine