Unengaged Pages
Beginner Mode
Objective
Write a SQL query to identify Facebook pages that have zero likes.
Table Schema:
- pages
| Column | Type | Description |
|---|---|---|
| page_id | INTEGER | Unique identifier for each Facebook page |
| page_name | VARCHAR | Name of the Facebook page |
- page_likes
| Column | Type | Description |
|---|---|---|
| user_id | INTEGER | ID of the user who liked the page |
| page_id | INTEGER | ID of the page that was liked |
| liked_date | DATETIME | Date and time when the like occurred |
Task Requirements:
- Identify pages that have no likes (pages that don't appear in the page_likes table)
- Return only the page IDs of pages with no likes
- Sort results in ascending order by page_id
Output columns: page_id
Examples
Example 1:
Output:
Input:
| page_likes | ||
|---|---|---|
| liked_date | page_id | user_id |
| 2024-01-15 10:00:00 | 101 | 1 |
| 2024-02-20 11:00:00 | 101 | 2 |
| 2024-03-10 12:00:00 | 103 | 3 |
| pages | |
|---|---|
| page_id | page_name |
| 101 | Tech News |
| 102 | Sports Updates |
| 103 | Food Blog |
| 104 | Travel Diaries |
| page_id |
|---|
| 102 |
| 104 |
Code Environment
Sign in or try as guest to run your code.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
Meta