Write SQL and Python, run instantly in your browser, and track your progress.
You are a Product Analyst at Meta. The Growth team is analyzing platform engagement to understand the size of the active contributor base. They want to identify all users who have meaningfully contributed content to the platform, either through posts or comments.
Your task is to create a unified list of user identifiers representing everyone who has either created a published post OR written a published comment. Users who have done both should appear only once in the results.
| Column Name | Type |
|---|---|
| post_id | INTEGER |
| user_id | INTEGER |
| content_text | TEXT |
You are a Product Analyst at Meta. The Growth team is analyzing platform engagement to understand the size of the active contributor base. They want to identify all users who have meaningfully contributed content to the platform, either through posts or comments.
Your task is to create a unified list of user identifiers representing everyone who has either created a published post OR written a published comment. Users who have done both should appear only once in the results.
| Column Name | Type |
|---|---|
| post_id | INTEGER |
| user_id | INTEGER |
| content_text | TEXT |
| content_type | TEXT |
| content_type | TEXT |
| link_url | TEXT |
| link_url | TEXT |
| visibility | TEXT |
| visibility | TEXT |
| created_at | TEXT |
| created_at | TEXT |
| status | TEXT |
| status | TEXT |
| Column Name | Type |
|---|---|
| comment_id | INTEGER |
| post_id | INTEGER |
| user_id | INTEGER |
| parent_comment_id | INTEGER |
| content_text | TEXT |
| created_at | TEXT |
| Column Name | Type |
|---|---|
| comment_id | INTEGER |
| post_id | INTEGER |
| user_id | INTEGER |
| parent_comment_id | INTEGER |
| content_text | TEXT |
| created_at | TEXT |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| comment_id | post_id | user_id | parent_comment_id | content_text | created_at | status |
|---|---|---|---|---|---|---|
| 1 | 1 | 29 | Facts! | 2025-07-28 16:59:36 | published | |
| 2 |
| comment_id | post_id | user_id | parent_comment_id | content_text | created_at | status |
|---|---|---|---|---|---|---|
| 1 | 1 | 29 | Facts! | 2025-07-28 16:59:36 | published | |
| 2 |
| user_id |
|---|
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| user_id |
|---|
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
Showing first 5 of 59 rows. Includes all users who have either posted or commented with published status.
Showing first 5 of 59 rows. Includes all users who have either posted or commented with published status.
1. Output Columns:
2. Set Operation:
3. Ordering:
1. Output Columns:
2. Set Operation:
3. Ordering:
| status | TEXT |
| status | TEXT |
| published |
| published |
| 2 | 1 | For everyone asking about technology, here's a helpful resource | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 2 | 1 | For everyone asking about technology, here's a helpful resource | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 1 |
| 1 |
| 46 |
| 46 |
| Thanks for the insights! |
| Thanks for the insights! |
| 2025-07-17 11:55:42 |
| 2025-07-17 11:55:42 |
| published |
| published |
| 3 | 1 | 2 | Great point! Never thought of it that way. | 2025-07-24 05:00:35 | published |
| 3 | 1 | 2 | Great point! Never thought of it that way. | 2025-07-24 05:00:35 | published |
| 4 | 1 | 22 | Saving this thread. | 2025-06-10 21:23:18 | published |
| 4 | 1 | 22 | Saving this thread. | 2025-06-10 21:23:18 | published |
| 5 | 3 | 25 | Exactly what I was thinking! | 2025-08-02 20:09:18 | hidden |
| 5 | 3 | 25 | Exactly what I was thinking! | 2025-08-02 20:09:18 | hidden |